@drincs/pixi-vn 0.5.3 → 0.5.5

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 -9
  8. package/dist/classes/ChoiceMenuOption.js.map +1 -1
  9. package/dist/classes/ChoiceMenuOption.mjs +1386 -9
  10. package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
  11. package/dist/classes/CloseLabel.d.mts +8 -5
  12. package/dist/classes/CloseLabel.d.ts +8 -5
  13. package/dist/classes/CloseLabel.js +44 -4
  14. package/dist/classes/CloseLabel.js.map +1 -1
  15. package/dist/classes/CloseLabel.mjs +41 -4
  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 +96 -68
  70. package/dist/functions/DialogueUtility.js.map +1 -1
  71. package/dist/functions/DialogueUtility.mjs +96 -68
  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 +113 -141
  88. package/dist/functions/SavesUtility.js.map +1 -1
  89. package/dist/functions/SavesUtility.mjs +113 -141
  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 +97 -69
  96. package/dist/functions/index.js.map +1 -1
  97. package/dist/functions/index.mjs +97 -69
  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 +359 -327
  102. package/dist/index.js.map +1 -1
  103. package/dist/index.mjs +358 -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 +53 -79
  122. package/dist/managers/StepManager.js.map +1 -1
  123. package/dist/managers/StepManager.mjs +53 -79
  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 +112 -140
  130. package/dist/managers/index.js.map +1 -1
  131. package/dist/managers/index.mjs +112 -140
  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,40 @@ 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
98
- var CloseLabel = class extends Label {
99
- };
133
+ var CLOSE_LABEL_ID = "__close-label-id__";
134
+ function newCloseLabel(choiseIndex) {
135
+ return new Label(CLOSE_LABEL_ID, [], void 0, choiseIndex);
136
+ }
100
137
 
101
138
  // src/decorators/LabelDecorator.ts
102
139
  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);
140
+ function getLabelById(id) {
141
+ let label = registeredLabels[id];
142
+ if (!label) {
143
+ console.error(`[Pixi'VN] Label ${id} not found`);
132
144
  return;
133
145
  }
146
+ return label;
134
147
  }
135
148
 
136
149
  // src/functions/ExportUtility.ts
@@ -1402,7 +1415,7 @@ var _GameStepManager = class _GameStepManager {
1402
1415
  */
1403
1416
  static get currentLabel() {
1404
1417
  if (_GameStepManager.currentLabelId) {
1405
- return getLabelInstanceByClassName(_GameStepManager.currentLabelId);
1418
+ return getLabelById(_GameStepManager.currentLabelId);
1406
1419
  }
1407
1420
  }
1408
1421
  static get currentLabelStepIndex() {
@@ -1423,7 +1436,7 @@ var _GameStepManager = class _GameStepManager {
1423
1436
  return true;
1424
1437
  } else {
1425
1438
  this.openedLabels.forEach((item) => {
1426
- let label = getLabelInstanceByClassName(item.label);
1439
+ let label = getLabelById(item.label);
1427
1440
  if (label && label.steps.length > item.currentStepIndex) {
1428
1441
  return false;
1429
1442
  }
@@ -1516,9 +1529,9 @@ var _GameStepManager = class _GameStepManager {
1516
1529
  * @param label The label to add to the history.
1517
1530
  */
1518
1531
  static pushNewLabel(label) {
1519
- let currentLabel = getLabelInstanceByClassName(label);
1532
+ let currentLabel = getLabelById(label);
1520
1533
  if (!currentLabel) {
1521
- throw new Error("[Pixi'VN] Label not found");
1534
+ throw new Error(`[Pixi'VN] Label ${label} not found`);
1522
1535
  }
1523
1536
  _GameStepManager._openedLabels.push({
1524
1537
  label,
@@ -1535,7 +1548,7 @@ var _GameStepManager = class _GameStepManager {
1535
1548
  return;
1536
1549
  }
1537
1550
  if (!_GameStepManager.currentLabel) {
1538
- console.error("[Pixi'VN] Label not found");
1551
+ console.error("[Pixi'VN] currentLabel not found");
1539
1552
  return;
1540
1553
  }
1541
1554
  _GameStepManager._openedLabels.pop();
@@ -1607,7 +1620,7 @@ var _GameStepManager = class _GameStepManager {
1607
1620
  }
1608
1621
  let currentLabel = _GameStepManager.currentLabel;
1609
1622
  if (!currentLabel) {
1610
- console.error("[Pixi'VN] Label not found");
1623
+ console.error("[Pixi'VN] currentLabel not found");
1611
1624
  return;
1612
1625
  }
1613
1626
  let n = currentLabel.steps.length;
@@ -1628,12 +1641,12 @@ var _GameStepManager = class _GameStepManager {
1628
1641
  /**
1629
1642
  * Execute the label and add it to the history.
1630
1643
  * Is a call function in Ren'Py.
1631
- * @param label The label to execute.
1644
+ * @param label The label to execute or the id of the label
1632
1645
  * @param props The props to pass to the label.
1633
1646
  * @returns StepLabelResultType or undefined.
1634
1647
  * @example
1635
1648
  * ```typescript
1636
- * GameStepManager.callLabel(StartLabel, yourParams).then((result) => {
1649
+ * GameStepManager.callLabel(startLabel, yourParams).then((result) => {
1637
1650
  * if (result) {
1638
1651
  * // your code
1639
1652
  * }
@@ -1642,7 +1655,7 @@ var _GameStepManager = class _GameStepManager {
1642
1655
  * @example
1643
1656
  * ```typescript
1644
1657
  * // if you use it in a step label you should return the result.
1645
- * return GameStepManager.callLabel(StartLabel).then((result) => {
1658
+ * return GameStepManager.callLabel(startLabel).then((result) => {
1646
1659
  * return result
1647
1660
  * })
1648
1661
  * ```
@@ -1650,16 +1663,24 @@ var _GameStepManager = class _GameStepManager {
1650
1663
  static callLabel(label, props) {
1651
1664
  return __async(this, null, function* () {
1652
1665
  let choiseMade = void 0;
1666
+ let labelId;
1667
+ if (typeof label === "string") {
1668
+ labelId = label;
1669
+ } else {
1670
+ labelId = label.id;
1671
+ if (typeof label.choiseIndex === "number") {
1672
+ choiseMade = label.choiseIndex;
1673
+ }
1674
+ }
1653
1675
  try {
1654
- if (label instanceof CloseLabel) {
1676
+ if (labelId === CLOSE_LABEL_ID) {
1655
1677
  return _GameStepManager.runNextStep(props);
1656
1678
  }
1657
- if (label instanceof Label) {
1658
- choiseMade = label.choiseIndex;
1659
- label = label.constructor;
1679
+ let tempLabel = getLabelById(labelId);
1680
+ if (!tempLabel) {
1681
+ throw new Error(`[Pixi'VN] Label ${labelId} not found`);
1660
1682
  }
1661
- let labelName = label.name;
1662
- _GameStepManager.pushNewLabel(labelName);
1683
+ _GameStepManager.pushNewLabel(tempLabel.id);
1663
1684
  } catch (e) {
1664
1685
  console.error("[Pixi'VN] Error calling label", e);
1665
1686
  return;
@@ -1671,11 +1692,11 @@ var _GameStepManager = class _GameStepManager {
1671
1692
  * Execute the label, close all labels and add them to the history.
1672
1693
  * Is a jump function in Ren'Py.
1673
1694
  * @param label The label to execute.
1674
- * @param props The props to pass to the label.
1695
+ * @param props The props to pass to the label or the id of the label
1675
1696
  * @returns StepLabelResultType or undefined.
1676
1697
  * @example
1677
1698
  * ```typescript
1678
- * GameStepManager.jumpLabel(StartLabel, yourParams).then((result) => {
1699
+ * GameStepManager.jumpLabel(startLabel, yourParams).then((result) => {
1679
1700
  * if (result) {
1680
1701
  * // your code
1681
1702
  * }
@@ -1684,7 +1705,7 @@ var _GameStepManager = class _GameStepManager {
1684
1705
  * @example
1685
1706
  * ```typescript
1686
1707
  * // if you use it in a step label you should return the result.
1687
- * return GameStepManager.jumpLabel(StartLabel).then((result) => {
1708
+ * return GameStepManager.jumpLabel(startLabel).then((result) => {
1688
1709
  * return result
1689
1710
  * })
1690
1711
  * ```
@@ -1692,15 +1713,24 @@ var _GameStepManager = class _GameStepManager {
1692
1713
  static jumpLabel(label, props) {
1693
1714
  return __async(this, null, function* () {
1694
1715
  _GameStepManager.closeAllLabels();
1716
+ let labelId;
1717
+ if (typeof label === "string") {
1718
+ labelId = label;
1719
+ } else {
1720
+ labelId = label.id;
1721
+ if (typeof label.choiseIndex === "number") {
1722
+ label.choiseIndex;
1723
+ }
1724
+ }
1695
1725
  try {
1696
- if (label instanceof CloseLabel) {
1726
+ if (labelId === CLOSE_LABEL_ID) {
1697
1727
  return _GameStepManager.runNextStep(props);
1698
1728
  }
1699
- if (label instanceof Label) {
1700
- label = label.constructor;
1729
+ let tempLabel = getLabelById(labelId);
1730
+ if (!tempLabel) {
1731
+ throw new Error(`[Pixi'VN] Label ${labelId} not found`);
1701
1732
  }
1702
- let labelName = label.name;
1703
- _GameStepManager.pushNewLabel(labelName);
1733
+ _GameStepManager.pushNewLabel(tempLabel.id);
1704
1734
  } catch (e) {
1705
1735
  console.error("[Pixi'VN] Error jumping label", e);
1706
1736
  return;
@@ -1930,7 +1960,7 @@ var ChoiceMenuOptionClose = class {
1930
1960
  /**
1931
1961
  * Label to be opened when the option is selected
1932
1962
  */
1933
- this.label = new CloseLabel();
1963
+ this.label = newCloseLabel();
1934
1964
  /**
1935
1965
  * Type of the label to be opened
1936
1966
  */
@@ -1944,7 +1974,7 @@ var ChoiceMenuOptionClose = class {
1944
1974
  };
1945
1975
 
1946
1976
  // src/classes/DialogueBaseModel.ts
1947
- var DialogueBaseModel2 = class {
1977
+ var DialogueBaseModel = class {
1948
1978
  /**
1949
1979
  * @param text The text of the dialogue.
1950
1980
  * @param character The id of the character that is speaking.
@@ -1996,8 +2026,8 @@ function setDialogue(props) {
1996
2026
  let dialogue;
1997
2027
  if (typeof props === "string") {
1998
2028
  text = props;
1999
- dialogue = new DialogueBaseModel2(text, characterId);
2000
- } else if (!(props instanceof DialogueBaseModel2)) {
2029
+ dialogue = new DialogueBaseModel(text, characterId);
2030
+ } else if (!(props instanceof DialogueBaseModel)) {
2001
2031
  text = props.text;
2002
2032
  if (props.character) {
2003
2033
  if (typeof props.character === "string") {
@@ -2006,7 +2036,7 @@ function setDialogue(props) {
2006
2036
  characterId = props.character.id;
2007
2037
  }
2008
2038
  }
2009
- dialogue = new DialogueBaseModel2(text, characterId);
2039
+ dialogue = new DialogueBaseModel(text, characterId);
2010
2040
  } else {
2011
2041
  dialogue = props;
2012
2042
  }
@@ -2028,7 +2058,7 @@ function setChoiceMenuOptions(options) {
2028
2058
  };
2029
2059
  }
2030
2060
  return __spreadProps(__spreadValues({}, option), {
2031
- label: option.label.constructor.name
2061
+ label: option.label.id
2032
2062
  });
2033
2063
  });
2034
2064
  GameStorageManager.setVariable(GameStorageManager.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY, value);
@@ -2040,8 +2070,7 @@ function getChoiceMenuOptions() {
2040
2070
  let options = [];
2041
2071
  d.forEach((option, index) => {
2042
2072
  if (option.type === Close) {
2043
- let itemLabel = new CloseLabel();
2044
- itemLabel.choiseIndex = index;
2073
+ let itemLabel = newCloseLabel(index);
2045
2074
  options.push({
2046
2075
  text: option.text,
2047
2076
  label: itemLabel,
@@ -2050,10 +2079,9 @@ function getChoiceMenuOptions() {
2050
2079
  });
2051
2080
  return;
2052
2081
  }
2053
- let label = getLabelTypeByClassName(option.label);
2082
+ let label = getLabelById(option.label);
2054
2083
  if (label) {
2055
- let itemLabel = new label();
2056
- itemLabel.choiseIndex = index;
2084
+ let itemLabel = new Label(label.id, label.steps, label.onStepRun, index);
2057
2085
  options.push(__spreadProps(__spreadValues({}, option), {
2058
2086
  label: itemLabel
2059
2087
  }));
@@ -2076,7 +2104,7 @@ function getDialogueHistory() {
2076
2104
  if (oldChoices) {
2077
2105
  let choiceMade = false;
2078
2106
  if (step.choiceIndexMade !== void 0 && oldChoices.length > step.choiceIndexMade) {
2079
- oldChoices[step.choiceIndexMade].isMadeChoice = true;
2107
+ oldChoices[step.choiceIndexMade].isResponse = true;
2080
2108
  choiceMade = true;
2081
2109
  }
2082
2110
  list[list.length - 1].playerMadeChoice = choiceMade;
@@ -2088,7 +2116,7 @@ function getDialogueHistory() {
2088
2116
  return {
2089
2117
  text: choice.text,
2090
2118
  type: choice.type,
2091
- isMadeChoice: false
2119
+ isResponse: false
2092
2120
  };
2093
2121
  });
2094
2122
  list.push({
@@ -2350,7 +2378,7 @@ function showWithDissolveTransition(tag, image, speed, priority) {
2350
2378
  }
2351
2379
 
2352
2380
  // src/constants.ts
2353
- var PIXIVN_VERSION = "0.5.3";
2381
+ var PIXIVN_VERSION = "0.5.5";
2354
2382
 
2355
2383
  // src/functions/SavesUtility.ts
2356
2384
  function getSaveData() {