@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
@@ -1,7 +1,6 @@
1
1
  import { StepHistoryDataType } from '../types/StepHistoryDataType.mjs';
2
2
  import { StepLabelType } from '../types/StepLabelType.mjs';
3
3
  import '@drincs/pixi-vn/dist/override';
4
- import '../types/StorageElementType.mjs';
5
4
 
6
5
  /**
7
6
  * Convert StepLabel to StepHistoryData
@@ -1,7 +1,6 @@
1
1
  import { StepHistoryDataType } from '../types/StepHistoryDataType.js';
2
2
  import { StepLabelType } from '../types/StepLabelType.js';
3
3
  import '@drincs/pixi-vn/dist/override';
4
- import '../types/StorageElementType.js';
5
4
 
6
5
  /**
7
6
  * Convert StepLabel to StepHistoryData
@@ -9,15 +9,15 @@ import '../classes/StoredClassModel.mjs';
9
9
  import '../types/ChoiceMenuOptionsType.mjs';
10
10
  import '../classes/ChoiceMenuOption.mjs';
11
11
  import '../classes/Label.mjs';
12
+ import '../types/LabelIdType.mjs';
13
+ import '../types/StepHistoryDataType.mjs';
12
14
  import '../types/StepLabelType.mjs';
13
15
  import '@drincs/pixi-vn/dist/override';
14
- import '../types/StorageElementType.mjs';
15
- import '../types/StepHistoryDataType.mjs';
16
16
  import '../types/CloseType.mjs';
17
17
  import '../types/LabelRunModeType.mjs';
18
- import '../types/LabelIdType.mjs';
18
+ import '../types/StorageElementType.mjs';
19
19
  import '../classes/DialogueBaseModel.mjs';
20
- import '../interface/IDialogueHistory.mjs';
20
+ import '../interface/DialogueHistory.mjs';
21
21
  import 'pixi.js';
22
22
  import '../classes/canvas/CanvasBase.mjs';
23
23
  import '../interface/canvas/ICanvasBaseMemory.mjs';
@@ -9,15 +9,15 @@ import '../classes/StoredClassModel.js';
9
9
  import '../types/ChoiceMenuOptionsType.js';
10
10
  import '../classes/ChoiceMenuOption.js';
11
11
  import '../classes/Label.js';
12
+ import '../types/LabelIdType.js';
13
+ import '../types/StepHistoryDataType.js';
12
14
  import '../types/StepLabelType.js';
13
15
  import '@drincs/pixi-vn/dist/override';
14
- import '../types/StorageElementType.js';
15
- import '../types/StepHistoryDataType.js';
16
16
  import '../types/CloseType.js';
17
17
  import '../types/LabelRunModeType.js';
18
- import '../types/LabelIdType.js';
18
+ import '../types/StorageElementType.js';
19
19
  import '../classes/DialogueBaseModel.js';
20
- import '../interface/IDialogueHistory.js';
20
+ import '../interface/DialogueHistory.js';
21
21
  import 'pixi.js';
22
22
  import '../classes/canvas/CanvasBase.js';
23
23
  import '../interface/canvas/ICanvasBaseMemory.js';
@@ -67,13 +67,31 @@ function checkIfStepsIsEqual(step1, step2) {
67
67
 
68
68
  // src/classes/Label.ts
69
69
  var Label = class {
70
+ /**
71
+ * @param id is the id of the label
72
+ * @param steps is the list of steps that the label will perform
73
+ * @param onStepRun is a function that will be executed before any step is executed, is useful for example to make sure all images used have been cached
74
+ * @param choiseIndex is the index of the choice that the label will perform
75
+ */
76
+ constructor(id, steps, onStepRun, choiseIndex) {
77
+ this._id = id;
78
+ this._steps = steps;
79
+ this._onStepRun = onStepRun;
80
+ this._choiseIndex = choiseIndex;
81
+ }
82
+ /**
83
+ * Get the id of the label
84
+ */
85
+ get id() {
86
+ return this._id;
87
+ }
70
88
  /**
71
89
  * Get the steps of the label.
72
90
  * This class should be extended and the steps method should be overridden.
73
91
  * Every time you update this list will also be updated when the other game versions load.
74
92
  */
75
93
  get steps() {
76
- throw new Error("[Pixi'VN] The method Label.steps must be overridden");
94
+ return this._steps;
77
95
  }
78
96
  /**
79
97
  * Get the corresponding steps number
@@ -92,45 +110,42 @@ var Label = class {
92
110
  });
93
111
  return res;
94
112
  }
113
+ /**
114
+ * Get the function that will be executed before any step is executed, is useful for example to make sure all images used have been cached
115
+ * @returns Promise<void> or void
116
+ * @example
117
+ * ```typescript
118
+ * newLabel("id", [], () => {
119
+ * Assets.load('path/to/image1.png')
120
+ * Assets.load('path/to/image2.png')
121
+ * })
122
+ * ```
123
+ */
124
+ get onStepRun() {
125
+ return this._onStepRun;
126
+ }
127
+ get choiseIndex() {
128
+ return this._choiseIndex;
129
+ }
95
130
  };
96
131
 
97
132
  // src/classes/CloseLabel.ts
133
+ var CLOSE_LABEL_ID = "__close-label-id__";
98
134
  var CloseLabel = class extends Label {
135
+ constructor(choiseIndex) {
136
+ super(CLOSE_LABEL_ID, [], void 0, choiseIndex);
137
+ }
99
138
  };
100
139
 
101
140
  // src/decorators/LabelDecorator.ts
102
141
  var registeredLabels = {};
103
- function getLabelTypeByClassName(labelName) {
104
- try {
105
- let labelType = registeredLabels[labelName];
106
- if (!labelType) {
107
- console.error(`[Pixi'VN] Label ${labelName} not found`);
108
- return;
109
- }
110
- new labelType();
111
- return labelType;
112
- } catch (e) {
113
- console.error(`[Pixi'VN] Error while getting Label ${labelName}`, e);
114
- return;
115
- }
116
- }
117
- function getLabelInstanceByClassName(labelName) {
118
- try {
119
- let labelType = registeredLabels[labelName];
120
- if (!labelType) {
121
- console.error(`[Pixi'VN] Label ${labelName} not found`);
122
- return;
123
- }
124
- let label = new labelType();
125
- let step = label.steps;
126
- if (step.length = 0) {
127
- console.warn(`[Pixi'VN] Label ${labelName} has no steps`);
128
- }
129
- return label;
130
- } catch (e) {
131
- console.error(`[Pixi'VN] Error while getting Label ${labelName}`, e);
142
+ function getLabelById(id) {
143
+ let label = registeredLabels[id];
144
+ if (!label) {
145
+ console.error(`[Pixi'VN] Label ${id} not found`);
132
146
  return;
133
147
  }
148
+ return label;
134
149
  }
135
150
 
136
151
  // src/functions/ExportUtility.ts
@@ -1402,7 +1417,7 @@ var _GameStepManager = class _GameStepManager {
1402
1417
  */
1403
1418
  static get currentLabel() {
1404
1419
  if (_GameStepManager.currentLabelId) {
1405
- return getLabelInstanceByClassName(_GameStepManager.currentLabelId);
1420
+ return getLabelById(_GameStepManager.currentLabelId);
1406
1421
  }
1407
1422
  }
1408
1423
  static get currentLabelStepIndex() {
@@ -1423,7 +1438,7 @@ var _GameStepManager = class _GameStepManager {
1423
1438
  return true;
1424
1439
  } else {
1425
1440
  this.openedLabels.forEach((item) => {
1426
- let label = getLabelInstanceByClassName(item.label);
1441
+ let label = getLabelById(item.label);
1427
1442
  if (label && label.steps.length > item.currentStepIndex) {
1428
1443
  return false;
1429
1444
  }
@@ -1516,9 +1531,9 @@ var _GameStepManager = class _GameStepManager {
1516
1531
  * @param label The label to add to the history.
1517
1532
  */
1518
1533
  static pushNewLabel(label) {
1519
- let currentLabel = getLabelInstanceByClassName(label);
1534
+ let currentLabel = getLabelById(label);
1520
1535
  if (!currentLabel) {
1521
- throw new Error("[Pixi'VN] Label not found");
1536
+ throw new Error(`[Pixi'VN] Label ${label} not found`);
1522
1537
  }
1523
1538
  _GameStepManager._openedLabels.push({
1524
1539
  label,
@@ -1535,7 +1550,7 @@ var _GameStepManager = class _GameStepManager {
1535
1550
  return;
1536
1551
  }
1537
1552
  if (!_GameStepManager.currentLabel) {
1538
- console.error("[Pixi'VN] Label not found");
1553
+ console.error("[Pixi'VN] currentLabel not found");
1539
1554
  return;
1540
1555
  }
1541
1556
  _GameStepManager._openedLabels.pop();
@@ -1607,7 +1622,7 @@ var _GameStepManager = class _GameStepManager {
1607
1622
  }
1608
1623
  let currentLabel = _GameStepManager.currentLabel;
1609
1624
  if (!currentLabel) {
1610
- console.error("[Pixi'VN] Label not found");
1625
+ console.error("[Pixi'VN] currentLabel not found");
1611
1626
  return;
1612
1627
  }
1613
1628
  let n = currentLabel.steps.length;
@@ -1628,12 +1643,12 @@ var _GameStepManager = class _GameStepManager {
1628
1643
  /**
1629
1644
  * Execute the label and add it to the history.
1630
1645
  * Is a call function in Ren'Py.
1631
- * @param label The label to execute.
1646
+ * @param label The label to execute or the id of the label
1632
1647
  * @param props The props to pass to the label.
1633
1648
  * @returns StepLabelResultType or undefined.
1634
1649
  * @example
1635
1650
  * ```typescript
1636
- * GameStepManager.callLabel(StartLabel, yourParams).then((result) => {
1651
+ * GameStepManager.callLabel(startLabel, yourParams).then((result) => {
1637
1652
  * if (result) {
1638
1653
  * // your code
1639
1654
  * }
@@ -1642,7 +1657,7 @@ var _GameStepManager = class _GameStepManager {
1642
1657
  * @example
1643
1658
  * ```typescript
1644
1659
  * // if you use it in a step label you should return the result.
1645
- * return GameStepManager.callLabel(StartLabel).then((result) => {
1660
+ * return GameStepManager.callLabel(startLabel).then((result) => {
1646
1661
  * return result
1647
1662
  * })
1648
1663
  * ```
@@ -1650,16 +1665,24 @@ var _GameStepManager = class _GameStepManager {
1650
1665
  static callLabel(label, props) {
1651
1666
  return __async(this, null, function* () {
1652
1667
  let choiseMade = void 0;
1668
+ let labelId;
1669
+ if (typeof label === "string") {
1670
+ labelId = label;
1671
+ } else {
1672
+ labelId = label.id;
1673
+ if (typeof label.choiseIndex === "number") {
1674
+ choiseMade = label.choiseIndex;
1675
+ }
1676
+ }
1653
1677
  try {
1654
- if (label instanceof CloseLabel) {
1678
+ if (labelId === CLOSE_LABEL_ID) {
1655
1679
  return _GameStepManager.runNextStep(props);
1656
1680
  }
1657
- if (label instanceof Label) {
1658
- choiseMade = label.choiseIndex;
1659
- label = label.constructor;
1681
+ let tempLabel = getLabelById(labelId);
1682
+ if (!tempLabel) {
1683
+ throw new Error(`[Pixi'VN] Label ${labelId} not found`);
1660
1684
  }
1661
- let labelName = label.name;
1662
- _GameStepManager.pushNewLabel(labelName);
1685
+ _GameStepManager.pushNewLabel(tempLabel.id);
1663
1686
  } catch (e) {
1664
1687
  console.error("[Pixi'VN] Error calling label", e);
1665
1688
  return;
@@ -1671,11 +1694,11 @@ var _GameStepManager = class _GameStepManager {
1671
1694
  * Execute the label, close all labels and add them to the history.
1672
1695
  * Is a jump function in Ren'Py.
1673
1696
  * @param label The label to execute.
1674
- * @param props The props to pass to the label.
1697
+ * @param props The props to pass to the label or the id of the label
1675
1698
  * @returns StepLabelResultType or undefined.
1676
1699
  * @example
1677
1700
  * ```typescript
1678
- * GameStepManager.jumpLabel(StartLabel, yourParams).then((result) => {
1701
+ * GameStepManager.jumpLabel(startLabel, yourParams).then((result) => {
1679
1702
  * if (result) {
1680
1703
  * // your code
1681
1704
  * }
@@ -1684,7 +1707,7 @@ var _GameStepManager = class _GameStepManager {
1684
1707
  * @example
1685
1708
  * ```typescript
1686
1709
  * // if you use it in a step label you should return the result.
1687
- * return GameStepManager.jumpLabel(StartLabel).then((result) => {
1710
+ * return GameStepManager.jumpLabel(startLabel).then((result) => {
1688
1711
  * return result
1689
1712
  * })
1690
1713
  * ```
@@ -1692,15 +1715,24 @@ var _GameStepManager = class _GameStepManager {
1692
1715
  static jumpLabel(label, props) {
1693
1716
  return __async(this, null, function* () {
1694
1717
  _GameStepManager.closeAllLabels();
1718
+ let labelId;
1719
+ if (typeof label === "string") {
1720
+ labelId = label;
1721
+ } else {
1722
+ labelId = label.id;
1723
+ if (typeof label.choiseIndex === "number") {
1724
+ label.choiseIndex;
1725
+ }
1726
+ }
1695
1727
  try {
1696
- if (label instanceof CloseLabel) {
1728
+ if (labelId === CLOSE_LABEL_ID) {
1697
1729
  return _GameStepManager.runNextStep(props);
1698
1730
  }
1699
- if (label instanceof Label) {
1700
- label = label.constructor;
1731
+ let tempLabel = getLabelById(labelId);
1732
+ if (!tempLabel) {
1733
+ throw new Error(`[Pixi'VN] Label ${labelId} not found`);
1701
1734
  }
1702
- let labelName = label.name;
1703
- _GameStepManager.pushNewLabel(labelName);
1735
+ _GameStepManager.pushNewLabel(tempLabel.id);
1704
1736
  } catch (e) {
1705
1737
  console.error("[Pixi'VN] Error jumping label", e);
1706
1738
  return;
@@ -1714,14 +1746,14 @@ var _GameStepManager = class _GameStepManager {
1714
1746
  * @returns StepLabelResultType or undefined.
1715
1747
  * @example
1716
1748
  * ```typescript
1717
- * GameStepManager.exitToChoiceMenu(yourParams).then((result) => {
1749
+ * GameStepManager.closeChoiceMenu(yourParams).then((result) => {
1718
1750
  * if (result) {
1719
1751
  * // your code
1720
1752
  * }
1721
1753
  * })
1722
1754
  * ```
1723
1755
  */
1724
- static exitToChoiceMenu(props) {
1756
+ static closeChoiceMenu(props) {
1725
1757
  return __async(this, null, function* () {
1726
1758
  return _GameStepManager.runNextStep(props);
1727
1759
  });
@@ -1944,7 +1976,7 @@ var ChoiceMenuOptionClose = class {
1944
1976
  };
1945
1977
 
1946
1978
  // src/classes/DialogueBaseModel.ts
1947
- var DialogueBaseModel2 = class {
1979
+ var DialogueBaseModel = class {
1948
1980
  /**
1949
1981
  * @param text The text of the dialogue.
1950
1982
  * @param character The id of the character that is speaking.
@@ -1996,8 +2028,8 @@ function setDialogue(props) {
1996
2028
  let dialogue;
1997
2029
  if (typeof props === "string") {
1998
2030
  text = props;
1999
- dialogue = new DialogueBaseModel2(text, characterId);
2000
- } else if (!(props instanceof DialogueBaseModel2)) {
2031
+ dialogue = new DialogueBaseModel(text, characterId);
2032
+ } else if (!(props instanceof DialogueBaseModel)) {
2001
2033
  text = props.text;
2002
2034
  if (props.character) {
2003
2035
  if (typeof props.character === "string") {
@@ -2006,7 +2038,7 @@ function setDialogue(props) {
2006
2038
  characterId = props.character.id;
2007
2039
  }
2008
2040
  }
2009
- dialogue = new DialogueBaseModel2(text, characterId);
2041
+ dialogue = new DialogueBaseModel(text, characterId);
2010
2042
  } else {
2011
2043
  dialogue = props;
2012
2044
  }
@@ -2028,7 +2060,7 @@ function setChoiceMenuOptions(options) {
2028
2060
  };
2029
2061
  }
2030
2062
  return __spreadProps(__spreadValues({}, option), {
2031
- label: option.label.constructor.name
2063
+ label: option.label.id
2032
2064
  });
2033
2065
  });
2034
2066
  GameStorageManager.setVariable(GameStorageManager.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY, value);
@@ -2040,8 +2072,7 @@ function getChoiceMenuOptions() {
2040
2072
  let options = [];
2041
2073
  d.forEach((option, index) => {
2042
2074
  if (option.type === Close) {
2043
- let itemLabel = new CloseLabel();
2044
- itemLabel.choiseIndex = index;
2075
+ let itemLabel = new CloseLabel(index);
2045
2076
  options.push({
2046
2077
  text: option.text,
2047
2078
  label: itemLabel,
@@ -2050,10 +2081,9 @@ function getChoiceMenuOptions() {
2050
2081
  });
2051
2082
  return;
2052
2083
  }
2053
- let label = getLabelTypeByClassName(option.label);
2084
+ let label = getLabelById(option.label);
2054
2085
  if (label) {
2055
- let itemLabel = new label();
2056
- itemLabel.choiseIndex = index;
2086
+ let itemLabel = new Label(label.id, label.steps, label.onStepRun, index);
2057
2087
  options.push(__spreadProps(__spreadValues({}, option), {
2058
2088
  label: itemLabel
2059
2089
  }));
@@ -2076,7 +2106,7 @@ function getDialogueHistory() {
2076
2106
  if (oldChoices) {
2077
2107
  let choiceMade = false;
2078
2108
  if (step.choiceIndexMade !== void 0 && oldChoices.length > step.choiceIndexMade) {
2079
- oldChoices[step.choiceIndexMade].isMadeChoice = true;
2109
+ oldChoices[step.choiceIndexMade].isResponse = true;
2080
2110
  choiceMade = true;
2081
2111
  }
2082
2112
  list[list.length - 1].playerMadeChoice = choiceMade;
@@ -2088,7 +2118,7 @@ function getDialogueHistory() {
2088
2118
  return {
2089
2119
  text: choice.text,
2090
2120
  type: choice.type,
2091
- isMadeChoice: false
2121
+ isResponse: false
2092
2122
  };
2093
2123
  });
2094
2124
  list.push({
@@ -2350,7 +2380,7 @@ function showWithDissolveTransition(tag, image, speed, priority) {
2350
2380
  }
2351
2381
 
2352
2382
  // src/constants.ts
2353
- var PIXIVN_VERSION = "0.5.2";
2383
+ var PIXIVN_VERSION = "0.5.4";
2354
2384
 
2355
2385
  // src/functions/SavesUtility.ts
2356
2386
  function getSaveData() {