@drincs/pixi-vn 0.6.5 → 0.6.7

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 (202) hide show
  1. package/README.md +49 -3
  2. package/dist/classes/CharacterBaseModel.js +57 -57
  3. package/dist/classes/CharacterBaseModel.js.map +1 -1
  4. package/dist/classes/CharacterBaseModel.mjs +57 -57
  5. package/dist/classes/CharacterBaseModel.mjs.map +1 -1
  6. package/dist/classes/ChoiceMenuOption.d.mts +5 -2
  7. package/dist/classes/ChoiceMenuOption.d.ts +5 -2
  8. package/dist/classes/ChoiceMenuOption.js +42 -25
  9. package/dist/classes/ChoiceMenuOption.js.map +1 -1
  10. package/dist/classes/ChoiceMenuOption.mjs +42 -25
  11. package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
  12. package/dist/classes/CloseLabel.d.mts +3 -1
  13. package/dist/classes/CloseLabel.d.ts +3 -1
  14. package/dist/classes/CloseLabel.js +25 -16
  15. package/dist/classes/CloseLabel.js.map +1 -1
  16. package/dist/classes/CloseLabel.mjs +25 -16
  17. package/dist/classes/CloseLabel.mjs.map +1 -1
  18. package/dist/classes/Label.d.mts +45 -4
  19. package/dist/classes/Label.d.ts +45 -4
  20. package/dist/classes/Label.js +25 -16
  21. package/dist/classes/Label.js.map +1 -1
  22. package/dist/classes/Label.mjs +25 -16
  23. package/dist/classes/Label.mjs.map +1 -1
  24. package/dist/classes/LabelAbstract.d.mts +50 -0
  25. package/dist/classes/LabelAbstract.d.ts +50 -0
  26. package/dist/classes/LabelAbstract.js +100 -0
  27. package/dist/classes/LabelAbstract.js.map +1 -0
  28. package/dist/classes/LabelAbstract.mjs +98 -0
  29. package/dist/classes/LabelAbstract.mjs.map +1 -0
  30. package/dist/classes/LabelJson.d.mts +30 -0
  31. package/dist/classes/LabelJson.d.ts +30 -0
  32. package/dist/classes/LabelJson.js +2766 -0
  33. package/dist/classes/LabelJson.js.map +1 -0
  34. package/dist/classes/LabelJson.mjs +2760 -0
  35. package/dist/classes/LabelJson.mjs.map +1 -0
  36. package/dist/classes/StoredClassModel.js.map +1 -1
  37. package/dist/classes/StoredClassModel.mjs.map +1 -1
  38. package/dist/classes/index.d.mts +6 -1
  39. package/dist/classes/index.d.ts +6 -1
  40. package/dist/classes/index.js +827 -26
  41. package/dist/classes/index.js.map +1 -1
  42. package/dist/classes/index.mjs +827 -27
  43. package/dist/classes/index.mjs.map +1 -1
  44. package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
  45. package/dist/classes/ticker/FadeAlphaTicker.mjs.map +1 -1
  46. package/dist/classes/ticker/MoveTicker.js.map +1 -1
  47. package/dist/classes/ticker/MoveTicker.mjs.map +1 -1
  48. package/dist/classes/ticker/RotateTicker.js.map +1 -1
  49. package/dist/classes/ticker/RotateTicker.mjs.map +1 -1
  50. package/dist/classes/ticker/ZoomTicker.js.map +1 -1
  51. package/dist/classes/ticker/ZoomTicker.mjs.map +1 -1
  52. package/dist/classes/ticker/index.js.map +1 -1
  53. package/dist/classes/ticker/index.mjs.map +1 -1
  54. package/dist/constants.d.mts +1 -1
  55. package/dist/constants.d.ts +1 -1
  56. package/dist/constants.js +1 -1
  57. package/dist/constants.js.map +1 -1
  58. package/dist/constants.mjs +1 -1
  59. package/dist/constants.mjs.map +1 -1
  60. package/dist/decorators/LabelDecorator.d.mts +19 -5
  61. package/dist/decorators/LabelDecorator.d.ts +19 -5
  62. package/dist/decorators/LabelDecorator.js +29 -16
  63. package/dist/decorators/LabelDecorator.js.map +1 -1
  64. package/dist/decorators/LabelDecorator.mjs +29 -17
  65. package/dist/decorators/LabelDecorator.mjs.map +1 -1
  66. package/dist/decorators/index.d.mts +10 -2
  67. package/dist/decorators/index.d.ts +10 -2
  68. package/dist/decorators/index.js +25 -16
  69. package/dist/decorators/index.js.map +1 -1
  70. package/dist/decorators/index.mjs +25 -16
  71. package/dist/decorators/index.mjs.map +1 -1
  72. package/dist/functions/DialogueUtility.d.mts +3 -1
  73. package/dist/functions/DialogueUtility.d.ts +3 -1
  74. package/dist/functions/DialogueUtility.js +85 -26
  75. package/dist/functions/DialogueUtility.js.map +1 -1
  76. package/dist/functions/DialogueUtility.mjs +85 -26
  77. package/dist/functions/DialogueUtility.mjs.map +1 -1
  78. package/dist/functions/FlagsUtility.js.map +1 -1
  79. package/dist/functions/FlagsUtility.mjs.map +1 -1
  80. package/dist/functions/GameUtility.js.map +1 -1
  81. package/dist/functions/GameUtility.mjs.map +1 -1
  82. package/dist/functions/ImageUtility.js.map +1 -1
  83. package/dist/functions/ImageUtility.mjs.map +1 -1
  84. package/dist/functions/Importer.d.mts +24 -0
  85. package/dist/functions/Importer.d.ts +24 -0
  86. package/dist/functions/Importer.js +2804 -0
  87. package/dist/functions/Importer.js.map +1 -0
  88. package/dist/functions/Importer.mjs +2798 -0
  89. package/dist/functions/Importer.mjs.map +1 -0
  90. package/dist/functions/SavesUtility.d.mts +3 -1
  91. package/dist/functions/SavesUtility.d.ts +3 -1
  92. package/dist/functions/SavesUtility.js +139 -36
  93. package/dist/functions/SavesUtility.js.map +1 -1
  94. package/dist/functions/SavesUtility.mjs +139 -36
  95. package/dist/functions/SavesUtility.mjs.map +1 -1
  96. package/dist/functions/index.d.mts +6 -1
  97. package/dist/functions/index.d.ts +6 -1
  98. package/dist/functions/index.js +169 -27
  99. package/dist/functions/index.js.map +1 -1
  100. package/dist/functions/index.mjs +169 -28
  101. package/dist/functions/index.mjs.map +1 -1
  102. package/dist/index.d.mts +7 -1
  103. package/dist/index.d.ts +7 -1
  104. package/dist/index.js +131 -36
  105. package/dist/index.js.map +1 -1
  106. package/dist/index.mjs +130 -37
  107. package/dist/index.mjs.map +1 -1
  108. package/dist/interface/IHistoryStep.d.mts +3 -1
  109. package/dist/interface/IHistoryStep.d.ts +3 -1
  110. package/dist/interface/ISaveData.d.mts +3 -1
  111. package/dist/interface/ISaveData.d.ts +3 -1
  112. package/dist/interface/LabelProps.d.mts +38 -5
  113. package/dist/interface/LabelProps.d.ts +38 -5
  114. package/dist/interface/export/ExportedStep.d.mts +3 -1
  115. package/dist/interface/export/ExportedStep.d.ts +3 -1
  116. package/dist/interface/export/index.d.mts +3 -1
  117. package/dist/interface/export/index.d.ts +3 -1
  118. package/dist/interface/index.d.mts +6 -4
  119. package/dist/interface/index.d.ts +6 -4
  120. package/dist/labels/BaseCanvasElementTestLabel.d.mts +3 -1
  121. package/dist/labels/BaseCanvasElementTestLabel.d.ts +3 -1
  122. package/dist/labels/BaseCanvasElementTestLabel.js +129 -26
  123. package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
  124. package/dist/labels/BaseCanvasElementTestLabel.mjs +130 -27
  125. package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -1
  126. package/dist/labels/CanvasEventsTestLabel.d.mts +3 -1
  127. package/dist/labels/CanvasEventsTestLabel.d.ts +3 -1
  128. package/dist/labels/CanvasEventsTestLabel.js +129 -26
  129. package/dist/labels/CanvasEventsTestLabel.js.map +1 -1
  130. package/dist/labels/CanvasEventsTestLabel.mjs +129 -26
  131. package/dist/labels/CanvasEventsTestLabel.mjs.map +1 -1
  132. package/dist/labels/CustomTickerCanvasElementTestLabel.d.mts +3 -1
  133. package/dist/labels/CustomTickerCanvasElementTestLabel.d.ts +3 -1
  134. package/dist/labels/CustomTickerCanvasElementTestLabel.js +129 -26
  135. package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -1
  136. package/dist/labels/CustomTickerCanvasElementTestLabel.mjs +130 -27
  137. package/dist/labels/CustomTickerCanvasElementTestLabel.mjs.map +1 -1
  138. package/dist/labels/ImagesAnimationsTestLabel.d.mts +3 -1
  139. package/dist/labels/ImagesAnimationsTestLabel.d.ts +3 -1
  140. package/dist/labels/ImagesAnimationsTestLabel.js +46 -35
  141. package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -1
  142. package/dist/labels/ImagesAnimationsTestLabel.mjs +47 -36
  143. package/dist/labels/ImagesAnimationsTestLabel.mjs.map +1 -1
  144. package/dist/labels/MarkdownTest.d.mts +3 -1
  145. package/dist/labels/MarkdownTest.d.ts +3 -1
  146. package/dist/labels/MarkdownTest.js +129 -26
  147. package/dist/labels/MarkdownTest.js.map +1 -1
  148. package/dist/labels/MarkdownTest.mjs +129 -26
  149. package/dist/labels/MarkdownTest.mjs.map +1 -1
  150. package/dist/labels/StartLabel.d.mts +3 -1
  151. package/dist/labels/StartLabel.d.ts +3 -1
  152. package/dist/labels/StartLabel.js +47 -36
  153. package/dist/labels/StartLabel.js.map +1 -1
  154. package/dist/labels/StartLabel.mjs +47 -36
  155. package/dist/labels/StartLabel.mjs.map +1 -1
  156. package/dist/labels/StepLabelTest.d.mts +3 -1
  157. package/dist/labels/StepLabelTest.d.ts +3 -1
  158. package/dist/labels/StepLabelTest.js +129 -26
  159. package/dist/labels/StepLabelTest.js.map +1 -1
  160. package/dist/labels/StepLabelTest.mjs +129 -26
  161. package/dist/labels/StepLabelTest.mjs.map +1 -1
  162. package/dist/labels/TestConstant.js.map +1 -1
  163. package/dist/labels/TestConstant.mjs.map +1 -1
  164. package/dist/labels/index.d.mts +3 -1
  165. package/dist/labels/index.d.ts +3 -1
  166. package/dist/labels/index.js +47 -36
  167. package/dist/labels/index.js.map +1 -1
  168. package/dist/labels/index.mjs +47 -36
  169. package/dist/labels/index.mjs.map +1 -1
  170. package/dist/managers/StepManager.d.mts +5 -3
  171. package/dist/managers/StepManager.d.ts +5 -3
  172. package/dist/managers/StepManager.js +138 -35
  173. package/dist/managers/StepManager.js.map +1 -1
  174. package/dist/managers/StepManager.mjs +138 -35
  175. package/dist/managers/StepManager.mjs.map +1 -1
  176. package/dist/managers/WindowManager.js.map +1 -1
  177. package/dist/managers/WindowManager.mjs.map +1 -1
  178. package/dist/managers/index.d.mts +7 -5
  179. package/dist/managers/index.d.ts +7 -5
  180. package/dist/managers/index.js +138 -35
  181. package/dist/managers/index.js.map +1 -1
  182. package/dist/managers/index.mjs +138 -35
  183. package/dist/managers/index.mjs.map +1 -1
  184. package/dist/types/ChoiceMenuOptionsType.d.mts +3 -1
  185. package/dist/types/ChoiceMenuOptionsType.d.ts +3 -1
  186. package/dist/types/LabelJsonType.d.mts +22 -0
  187. package/dist/types/LabelJsonType.d.ts +22 -0
  188. package/dist/types/LabelJsonType.js +4 -0
  189. package/dist/types/LabelJsonType.js.map +1 -0
  190. package/dist/types/LabelJsonType.mjs +3 -0
  191. package/dist/types/LabelJsonType.mjs.map +1 -0
  192. package/dist/types/StepLabelJsonType.d.mts +30 -0
  193. package/dist/types/StepLabelJsonType.d.ts +30 -0
  194. package/dist/types/StepLabelJsonType.js +4 -0
  195. package/dist/types/StepLabelJsonType.js.map +1 -0
  196. package/dist/types/StepLabelJsonType.mjs +3 -0
  197. package/dist/types/StepLabelJsonType.mjs.map +1 -0
  198. package/dist/types/index.d.mts +5 -1
  199. package/dist/types/index.d.ts +5 -1
  200. package/package.json +3 -2
  201. package/dist/LabelProps-CFV-zRjG.d.ts +0 -113
  202. package/dist/LabelProps-CmRpvUJm.d.mts +0 -113
@@ -553,16 +553,14 @@ function checkIfStepsIsEqual(step1, step2) {
553
553
  return step1 === step2;
554
554
  }
555
555
 
556
- // src/classes/Label.ts
557
- var Label = class {
556
+ // src/classes/LabelAbstract.ts
557
+ var LabelAbstract = class {
558
558
  /**
559
559
  * @param id is the id of the label
560
- * @param steps is the list of steps that the label will perform
561
560
  * @param props is the properties of the label
562
561
  */
563
- constructor(id, steps, props) {
562
+ constructor(id, props) {
564
563
  this._id = id;
565
- this._steps = steps;
566
564
  this._onStepStart = props == null ? void 0 : props.onStepStart;
567
565
  this._onLoadStep = props == null ? void 0 : props.onLoadStep;
568
566
  this._onStepEnd = props == null ? void 0 : props.onStepEnd;
@@ -574,17 +572,6 @@ var Label = class {
574
572
  get id() {
575
573
  return this._id;
576
574
  }
577
- /**
578
- * Get the steps of the label.
579
- * This class should be extended and the steps method should be overridden.
580
- * Every time you update this list will also be updated when the other game versions load.
581
- */
582
- get steps() {
583
- if (typeof this._steps === "function") {
584
- return this._steps();
585
- }
586
- return this._steps;
587
- }
588
575
  /**
589
576
  * Get the corresponding steps number
590
577
  * @param externalSteps
@@ -635,6 +622,28 @@ var Label = class {
635
622
  }
636
623
  };
637
624
 
625
+ // src/classes/Label.ts
626
+ var Label = class extends LabelAbstract {
627
+ /**
628
+ * @param id is the id of the label
629
+ * @param steps is the list of steps that the label will perform
630
+ * @param props is the properties of the label
631
+ */
632
+ constructor(id, steps, props) {
633
+ super(id, props);
634
+ this._steps = steps;
635
+ }
636
+ /**
637
+ * Get the steps of the label.
638
+ */
639
+ get steps() {
640
+ if (typeof this._steps === "function") {
641
+ return this._steps();
642
+ }
643
+ return this._steps;
644
+ }
645
+ };
646
+
638
647
  // src/classes/CloseLabel.ts
639
648
  var CLOSE_LABEL_ID = "__close-label-id__";
640
649
  function newCloseLabel(choiseIndex) {
@@ -646,6 +655,106 @@ function newCloseLabel(choiseIndex) {
646
655
  // src/types/CloseType.ts
647
656
  var Close = "close";
648
657
 
658
+ // src/classes/ChoiceMenuOption.ts
659
+ var ChoiceMenuOption = class {
660
+ /**
661
+ * @param text Text to be displayed in the menu
662
+ * @param label Label to be opened when the option is selected or the id of the label
663
+ * @param props Properties to be passed to the label and olther parameters that you can use when get all the choice menu options. It be converted to a JSON string, so it cannot contain functions or classes.
664
+ * @param type Type of the label to be opened. @default "call"
665
+ */
666
+ constructor(text, label, props, type = "call") {
667
+ /**
668
+ * Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
669
+ * @example
670
+ * ```tsx
671
+ * setChoiceMenuOptions([
672
+ * new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
673
+ * ])
674
+ * return <List>
675
+ * {getChoiceMenuOptions()?.map((item, index) => {
676
+ * return (
677
+ * <ChoiceButton
678
+ * disabled={item.props.disabled}
679
+ * onClick={() => {
680
+ * afterSelectChoice(item)
681
+ * }}
682
+ * >
683
+ * {item.text}
684
+ * </ChoiceButton>
685
+ * )
686
+ * })}
687
+ * </List>
688
+ * ```
689
+ */
690
+ this.props = {};
691
+ this.text = text;
692
+ this._label = label;
693
+ this.type = type;
694
+ if (props) {
695
+ this.props = props;
696
+ }
697
+ }
698
+ /**
699
+ * Label to be opened when the option is selected
700
+ */
701
+ get label() {
702
+ let label = this._label;
703
+ if (typeof label === "string") {
704
+ let res = getLabelById(label);
705
+ if (res) {
706
+ label = res;
707
+ } else {
708
+ console.error(`Label ${label} not found, so it will be closed`);
709
+ label = newCloseLabel();
710
+ }
711
+ }
712
+ return label;
713
+ }
714
+ };
715
+ var ChoiceMenuOptionClose = class {
716
+ /**
717
+ * @param text Text to be displayed in the menu
718
+ * @param closeCurrentLabel If true, the current label will be closed. @default false
719
+ */
720
+ constructor(text, closeCurrentLabel = false) {
721
+ /**
722
+ * Label to be opened when the option is selected
723
+ */
724
+ this.label = newCloseLabel();
725
+ /**
726
+ * Type of the label to be opened
727
+ */
728
+ this.type = Close;
729
+ /**
730
+ * Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
731
+ * @example
732
+ * ```tsx
733
+ * setChoiceMenuOptions([
734
+ * new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
735
+ * ])
736
+ * return <List>
737
+ * {getChoiceMenuOptions()?.map((item, index) => {
738
+ * return (
739
+ * <ChoiceButton
740
+ * disabled={item.props.disabled}
741
+ * onClick={() => {
742
+ * afterSelectChoice(item)
743
+ * }}
744
+ * >
745
+ * {item.text}
746
+ * </ChoiceButton>
747
+ * )
748
+ * })}
749
+ * </List>
750
+ * ```
751
+ */
752
+ this.props = {};
753
+ this.text = text;
754
+ this.closeCurrentLabel = closeCurrentLabel;
755
+ }
756
+ };
757
+
649
758
  // src/functions/DialogueUtility.ts
650
759
  function setDialogue(props) {
651
760
  let text = "";
@@ -680,13 +789,9 @@ function getChoiceMenuOptions() {
680
789
  d.forEach((option, index) => {
681
790
  if (option.type === Close) {
682
791
  let itemLabel = newCloseLabel(index);
683
- options.push({
684
- text: option.text,
685
- label: itemLabel,
686
- type: Close,
687
- closeCurrentLabel: option.closeCurrentLabel,
688
- props: {}
689
- });
792
+ let choice = new ChoiceMenuOptionClose(option.text, option.closeCurrentLabel);
793
+ choice.label = itemLabel;
794
+ options.push(choice);
690
795
  return;
691
796
  }
692
797
  let label = getLabelById(option.label);
@@ -695,9 +800,7 @@ function getChoiceMenuOptions() {
695
800
  onStepStart: label.onStepStart,
696
801
  choiseIndex: index
697
802
  });
698
- options.push(__spreadProps(__spreadValues({}, option), {
699
- label: itemLabel
700
- }));
803
+ options.push(new ChoiceMenuOption(option.text, itemLabel, option.props, option.type));
701
804
  }
702
805
  });
703
806
  return options;