@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.
- package/README.md +49 -3
- package/dist/classes/CharacterBaseModel.js +57 -57
- package/dist/classes/CharacterBaseModel.js.map +1 -1
- package/dist/classes/CharacterBaseModel.mjs +57 -57
- package/dist/classes/CharacterBaseModel.mjs.map +1 -1
- package/dist/classes/ChoiceMenuOption.d.mts +5 -2
- package/dist/classes/ChoiceMenuOption.d.ts +5 -2
- package/dist/classes/ChoiceMenuOption.js +42 -25
- package/dist/classes/ChoiceMenuOption.js.map +1 -1
- package/dist/classes/ChoiceMenuOption.mjs +42 -25
- package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
- package/dist/classes/CloseLabel.d.mts +3 -1
- package/dist/classes/CloseLabel.d.ts +3 -1
- package/dist/classes/CloseLabel.js +25 -16
- package/dist/classes/CloseLabel.js.map +1 -1
- package/dist/classes/CloseLabel.mjs +25 -16
- package/dist/classes/CloseLabel.mjs.map +1 -1
- package/dist/classes/Label.d.mts +45 -4
- package/dist/classes/Label.d.ts +45 -4
- package/dist/classes/Label.js +25 -16
- package/dist/classes/Label.js.map +1 -1
- package/dist/classes/Label.mjs +25 -16
- package/dist/classes/Label.mjs.map +1 -1
- package/dist/classes/LabelAbstract.d.mts +50 -0
- package/dist/classes/LabelAbstract.d.ts +50 -0
- package/dist/classes/LabelAbstract.js +100 -0
- package/dist/classes/LabelAbstract.js.map +1 -0
- package/dist/classes/LabelAbstract.mjs +98 -0
- package/dist/classes/LabelAbstract.mjs.map +1 -0
- package/dist/classes/LabelJson.d.mts +30 -0
- package/dist/classes/LabelJson.d.ts +30 -0
- package/dist/classes/LabelJson.js +2766 -0
- package/dist/classes/LabelJson.js.map +1 -0
- package/dist/classes/LabelJson.mjs +2760 -0
- package/dist/classes/LabelJson.mjs.map +1 -0
- package/dist/classes/StoredClassModel.js.map +1 -1
- package/dist/classes/StoredClassModel.mjs.map +1 -1
- package/dist/classes/index.d.mts +6 -1
- package/dist/classes/index.d.ts +6 -1
- package/dist/classes/index.js +827 -26
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +827 -27
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.mjs.map +1 -1
- package/dist/classes/ticker/MoveTicker.js.map +1 -1
- package/dist/classes/ticker/MoveTicker.mjs.map +1 -1
- package/dist/classes/ticker/RotateTicker.js.map +1 -1
- package/dist/classes/ticker/RotateTicker.mjs.map +1 -1
- package/dist/classes/ticker/ZoomTicker.js.map +1 -1
- package/dist/classes/ticker/ZoomTicker.mjs.map +1 -1
- package/dist/classes/ticker/index.js.map +1 -1
- package/dist/classes/ticker/index.mjs.map +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/constants.mjs.map +1 -1
- package/dist/decorators/LabelDecorator.d.mts +19 -5
- package/dist/decorators/LabelDecorator.d.ts +19 -5
- package/dist/decorators/LabelDecorator.js +29 -16
- package/dist/decorators/LabelDecorator.js.map +1 -1
- package/dist/decorators/LabelDecorator.mjs +29 -17
- package/dist/decorators/LabelDecorator.mjs.map +1 -1
- package/dist/decorators/index.d.mts +10 -2
- package/dist/decorators/index.d.ts +10 -2
- package/dist/decorators/index.js +25 -16
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +25 -16
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/DialogueUtility.d.mts +3 -1
- package/dist/functions/DialogueUtility.d.ts +3 -1
- package/dist/functions/DialogueUtility.js +85 -26
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +85 -26
- package/dist/functions/DialogueUtility.mjs.map +1 -1
- package/dist/functions/FlagsUtility.js.map +1 -1
- package/dist/functions/FlagsUtility.mjs.map +1 -1
- package/dist/functions/GameUtility.js.map +1 -1
- package/dist/functions/GameUtility.mjs.map +1 -1
- package/dist/functions/ImageUtility.js.map +1 -1
- package/dist/functions/ImageUtility.mjs.map +1 -1
- package/dist/functions/Importer.d.mts +24 -0
- package/dist/functions/Importer.d.ts +24 -0
- package/dist/functions/Importer.js +2804 -0
- package/dist/functions/Importer.js.map +1 -0
- package/dist/functions/Importer.mjs +2798 -0
- package/dist/functions/Importer.mjs.map +1 -0
- package/dist/functions/SavesUtility.d.mts +3 -1
- package/dist/functions/SavesUtility.d.ts +3 -1
- package/dist/functions/SavesUtility.js +139 -36
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +139 -36
- package/dist/functions/SavesUtility.mjs.map +1 -1
- package/dist/functions/index.d.mts +6 -1
- package/dist/functions/index.d.ts +6 -1
- package/dist/functions/index.js +169 -27
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +169 -28
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +131 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +130 -37
- package/dist/index.mjs.map +1 -1
- package/dist/interface/IHistoryStep.d.mts +3 -1
- package/dist/interface/IHistoryStep.d.ts +3 -1
- package/dist/interface/ISaveData.d.mts +3 -1
- package/dist/interface/ISaveData.d.ts +3 -1
- package/dist/interface/LabelProps.d.mts +38 -5
- package/dist/interface/LabelProps.d.ts +38 -5
- package/dist/interface/export/ExportedStep.d.mts +3 -1
- package/dist/interface/export/ExportedStep.d.ts +3 -1
- package/dist/interface/export/index.d.mts +3 -1
- package/dist/interface/export/index.d.ts +3 -1
- package/dist/interface/index.d.mts +6 -4
- package/dist/interface/index.d.ts +6 -4
- package/dist/labels/BaseCanvasElementTestLabel.d.mts +3 -1
- package/dist/labels/BaseCanvasElementTestLabel.d.ts +3 -1
- package/dist/labels/BaseCanvasElementTestLabel.js +129 -26
- package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/BaseCanvasElementTestLabel.mjs +130 -27
- package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -1
- package/dist/labels/CanvasEventsTestLabel.d.mts +3 -1
- package/dist/labels/CanvasEventsTestLabel.d.ts +3 -1
- package/dist/labels/CanvasEventsTestLabel.js +129 -26
- package/dist/labels/CanvasEventsTestLabel.js.map +1 -1
- package/dist/labels/CanvasEventsTestLabel.mjs +129 -26
- package/dist/labels/CanvasEventsTestLabel.mjs.map +1 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.d.mts +3 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.d.ts +3 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.js +129 -26
- package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs +130 -27
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs.map +1 -1
- package/dist/labels/ImagesAnimationsTestLabel.d.mts +3 -1
- package/dist/labels/ImagesAnimationsTestLabel.d.ts +3 -1
- package/dist/labels/ImagesAnimationsTestLabel.js +46 -35
- package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -1
- package/dist/labels/ImagesAnimationsTestLabel.mjs +47 -36
- package/dist/labels/ImagesAnimationsTestLabel.mjs.map +1 -1
- package/dist/labels/MarkdownTest.d.mts +3 -1
- package/dist/labels/MarkdownTest.d.ts +3 -1
- package/dist/labels/MarkdownTest.js +129 -26
- package/dist/labels/MarkdownTest.js.map +1 -1
- package/dist/labels/MarkdownTest.mjs +129 -26
- package/dist/labels/MarkdownTest.mjs.map +1 -1
- package/dist/labels/StartLabel.d.mts +3 -1
- package/dist/labels/StartLabel.d.ts +3 -1
- package/dist/labels/StartLabel.js +47 -36
- package/dist/labels/StartLabel.js.map +1 -1
- package/dist/labels/StartLabel.mjs +47 -36
- package/dist/labels/StartLabel.mjs.map +1 -1
- package/dist/labels/StepLabelTest.d.mts +3 -1
- package/dist/labels/StepLabelTest.d.ts +3 -1
- package/dist/labels/StepLabelTest.js +129 -26
- package/dist/labels/StepLabelTest.js.map +1 -1
- package/dist/labels/StepLabelTest.mjs +129 -26
- package/dist/labels/StepLabelTest.mjs.map +1 -1
- package/dist/labels/TestConstant.js.map +1 -1
- package/dist/labels/TestConstant.mjs.map +1 -1
- package/dist/labels/index.d.mts +3 -1
- package/dist/labels/index.d.ts +3 -1
- package/dist/labels/index.js +47 -36
- package/dist/labels/index.js.map +1 -1
- package/dist/labels/index.mjs +47 -36
- package/dist/labels/index.mjs.map +1 -1
- package/dist/managers/StepManager.d.mts +5 -3
- package/dist/managers/StepManager.d.ts +5 -3
- package/dist/managers/StepManager.js +138 -35
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +138 -35
- package/dist/managers/StepManager.mjs.map +1 -1
- package/dist/managers/WindowManager.js.map +1 -1
- package/dist/managers/WindowManager.mjs.map +1 -1
- package/dist/managers/index.d.mts +7 -5
- package/dist/managers/index.d.ts +7 -5
- package/dist/managers/index.js +138 -35
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +138 -35
- package/dist/managers/index.mjs.map +1 -1
- package/dist/types/ChoiceMenuOptionsType.d.mts +3 -1
- package/dist/types/ChoiceMenuOptionsType.d.ts +3 -1
- package/dist/types/LabelJsonType.d.mts +22 -0
- package/dist/types/LabelJsonType.d.ts +22 -0
- package/dist/types/LabelJsonType.js +4 -0
- package/dist/types/LabelJsonType.js.map +1 -0
- package/dist/types/LabelJsonType.mjs +3 -0
- package/dist/types/LabelJsonType.mjs.map +1 -0
- package/dist/types/StepLabelJsonType.d.mts +30 -0
- package/dist/types/StepLabelJsonType.d.ts +30 -0
- package/dist/types/StepLabelJsonType.js +4 -0
- package/dist/types/StepLabelJsonType.js.map +1 -0
- package/dist/types/StepLabelJsonType.mjs +3 -0
- package/dist/types/StepLabelJsonType.mjs.map +1 -0
- package/dist/types/index.d.mts +5 -1
- package/dist/types/index.d.ts +5 -1
- package/package.json +3 -2
- package/dist/LabelProps-CFV-zRjG.d.ts +0 -113
- package/dist/LabelProps-CmRpvUJm.d.mts +0 -113
|
@@ -52,7 +52,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
// src/constants.ts
|
|
55
|
-
var PIXIVN_VERSION = "0.6.
|
|
55
|
+
var PIXIVN_VERSION = "0.6.7";
|
|
56
56
|
var Repeat = "repeat";
|
|
57
57
|
function getStepSha1(step) {
|
|
58
58
|
let sha1String = sha1(step.toString().toLocaleLowerCase());
|
|
@@ -62,16 +62,14 @@ function checkIfStepsIsEqual(step1, step2) {
|
|
|
62
62
|
return step1 === step2;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
// src/classes/
|
|
66
|
-
var
|
|
65
|
+
// src/classes/LabelAbstract.ts
|
|
66
|
+
var LabelAbstract = class {
|
|
67
67
|
/**
|
|
68
68
|
* @param id is the id of the label
|
|
69
|
-
* @param steps is the list of steps that the label will perform
|
|
70
69
|
* @param props is the properties of the label
|
|
71
70
|
*/
|
|
72
|
-
constructor(id,
|
|
71
|
+
constructor(id, props) {
|
|
73
72
|
this._id = id;
|
|
74
|
-
this._steps = steps;
|
|
75
73
|
this._onStepStart = props == null ? void 0 : props.onStepStart;
|
|
76
74
|
this._onLoadStep = props == null ? void 0 : props.onLoadStep;
|
|
77
75
|
this._onStepEnd = props == null ? void 0 : props.onStepEnd;
|
|
@@ -83,17 +81,6 @@ var Label = class {
|
|
|
83
81
|
get id() {
|
|
84
82
|
return this._id;
|
|
85
83
|
}
|
|
86
|
-
/**
|
|
87
|
-
* Get the steps of the label.
|
|
88
|
-
* This class should be extended and the steps method should be overridden.
|
|
89
|
-
* Every time you update this list will also be updated when the other game versions load.
|
|
90
|
-
*/
|
|
91
|
-
get steps() {
|
|
92
|
-
if (typeof this._steps === "function") {
|
|
93
|
-
return this._steps();
|
|
94
|
-
}
|
|
95
|
-
return this._steps;
|
|
96
|
-
}
|
|
97
84
|
/**
|
|
98
85
|
* Get the corresponding steps number
|
|
99
86
|
* @param externalSteps
|
|
@@ -144,6 +131,28 @@ var Label = class {
|
|
|
144
131
|
}
|
|
145
132
|
};
|
|
146
133
|
|
|
134
|
+
// src/classes/Label.ts
|
|
135
|
+
var Label = class extends LabelAbstract {
|
|
136
|
+
/**
|
|
137
|
+
* @param id is the id of the label
|
|
138
|
+
* @param steps is the list of steps that the label will perform
|
|
139
|
+
* @param props is the properties of the label
|
|
140
|
+
*/
|
|
141
|
+
constructor(id, steps, props) {
|
|
142
|
+
super(id, props);
|
|
143
|
+
this._steps = steps;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Get the steps of the label.
|
|
147
|
+
*/
|
|
148
|
+
get steps() {
|
|
149
|
+
if (typeof this._steps === "function") {
|
|
150
|
+
return this._steps();
|
|
151
|
+
}
|
|
152
|
+
return this._steps;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
147
156
|
// src/classes/CloseLabel.ts
|
|
148
157
|
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
149
158
|
function newCloseLabel(choiseIndex) {
|
|
@@ -665,16 +674,105 @@ function geTickerInstanceById(tickerId, args, duration, priority) {
|
|
|
665
674
|
// src/types/CloseType.ts
|
|
666
675
|
var Close = "close";
|
|
667
676
|
|
|
668
|
-
// src/
|
|
669
|
-
var
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
677
|
+
// src/classes/ChoiceMenuOption.ts
|
|
678
|
+
var ChoiceMenuOption = class {
|
|
679
|
+
/**
|
|
680
|
+
* @param text Text to be displayed in the menu
|
|
681
|
+
* @param label Label to be opened when the option is selected or the id of the label
|
|
682
|
+
* @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.
|
|
683
|
+
* @param type Type of the label to be opened. @default "call"
|
|
684
|
+
*/
|
|
685
|
+
constructor(text, label, props, type = "call") {
|
|
686
|
+
/**
|
|
687
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
688
|
+
* @example
|
|
689
|
+
* ```tsx
|
|
690
|
+
* setChoiceMenuOptions([
|
|
691
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
692
|
+
* ])
|
|
693
|
+
* return <List>
|
|
694
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
695
|
+
* return (
|
|
696
|
+
* <ChoiceButton
|
|
697
|
+
* disabled={item.props.disabled}
|
|
698
|
+
* onClick={() => {
|
|
699
|
+
* afterSelectChoice(item)
|
|
700
|
+
* }}
|
|
701
|
+
* >
|
|
702
|
+
* {item.text}
|
|
703
|
+
* </ChoiceButton>
|
|
704
|
+
* )
|
|
705
|
+
* })}
|
|
706
|
+
* </List>
|
|
707
|
+
* ```
|
|
708
|
+
*/
|
|
709
|
+
this.props = {};
|
|
710
|
+
this.text = text;
|
|
711
|
+
this._label = label;
|
|
712
|
+
this.type = type;
|
|
713
|
+
if (props) {
|
|
714
|
+
this.props = props;
|
|
715
|
+
}
|
|
675
716
|
}
|
|
676
|
-
|
|
677
|
-
|
|
717
|
+
/**
|
|
718
|
+
* Label to be opened when the option is selected
|
|
719
|
+
*/
|
|
720
|
+
get label() {
|
|
721
|
+
let label = this._label;
|
|
722
|
+
if (typeof label === "string") {
|
|
723
|
+
let res = getLabelById(label);
|
|
724
|
+
if (res) {
|
|
725
|
+
label = res;
|
|
726
|
+
} else {
|
|
727
|
+
console.error(`Label ${label} not found, so it will be closed`);
|
|
728
|
+
label = newCloseLabel();
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
return label;
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
var ChoiceMenuOptionClose = class {
|
|
735
|
+
/**
|
|
736
|
+
* @param text Text to be displayed in the menu
|
|
737
|
+
* @param closeCurrentLabel If true, the current label will be closed. @default false
|
|
738
|
+
*/
|
|
739
|
+
constructor(text, closeCurrentLabel = false) {
|
|
740
|
+
/**
|
|
741
|
+
* Label to be opened when the option is selected
|
|
742
|
+
*/
|
|
743
|
+
this.label = newCloseLabel();
|
|
744
|
+
/**
|
|
745
|
+
* Type of the label to be opened
|
|
746
|
+
*/
|
|
747
|
+
this.type = Close;
|
|
748
|
+
/**
|
|
749
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
750
|
+
* @example
|
|
751
|
+
* ```tsx
|
|
752
|
+
* setChoiceMenuOptions([
|
|
753
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
754
|
+
* ])
|
|
755
|
+
* return <List>
|
|
756
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
757
|
+
* return (
|
|
758
|
+
* <ChoiceButton
|
|
759
|
+
* disabled={item.props.disabled}
|
|
760
|
+
* onClick={() => {
|
|
761
|
+
* afterSelectChoice(item)
|
|
762
|
+
* }}
|
|
763
|
+
* >
|
|
764
|
+
* {item.text}
|
|
765
|
+
* </ChoiceButton>
|
|
766
|
+
* )
|
|
767
|
+
* })}
|
|
768
|
+
* </List>
|
|
769
|
+
* ```
|
|
770
|
+
*/
|
|
771
|
+
this.props = {};
|
|
772
|
+
this.text = text;
|
|
773
|
+
this.closeCurrentLabel = closeCurrentLabel;
|
|
774
|
+
}
|
|
775
|
+
};
|
|
678
776
|
|
|
679
777
|
// src/functions/DialogueUtility.ts
|
|
680
778
|
function getDialogue() {
|
|
@@ -687,13 +785,9 @@ function getChoiceMenuOptions() {
|
|
|
687
785
|
d.forEach((option, index) => {
|
|
688
786
|
if (option.type === Close) {
|
|
689
787
|
let itemLabel = newCloseLabel(index);
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
type: Close,
|
|
694
|
-
closeCurrentLabel: option.closeCurrentLabel,
|
|
695
|
-
props: {}
|
|
696
|
-
});
|
|
788
|
+
let choice = new ChoiceMenuOptionClose(option.text, option.closeCurrentLabel);
|
|
789
|
+
choice.label = itemLabel;
|
|
790
|
+
options.push(choice);
|
|
697
791
|
return;
|
|
698
792
|
}
|
|
699
793
|
let label = getLabelById(option.label);
|
|
@@ -702,9 +796,7 @@ function getChoiceMenuOptions() {
|
|
|
702
796
|
onStepStart: label.onStepStart,
|
|
703
797
|
choiseIndex: index
|
|
704
798
|
});
|
|
705
|
-
options.push(
|
|
706
|
-
label: itemLabel
|
|
707
|
-
}));
|
|
799
|
+
options.push(new ChoiceMenuOption(option.text, itemLabel, option.props, option.type));
|
|
708
800
|
}
|
|
709
801
|
});
|
|
710
802
|
return options;
|
|
@@ -1030,6 +1122,17 @@ ZoomTicker = __decorateClass([
|
|
|
1030
1122
|
tickerDecorator()
|
|
1031
1123
|
], ZoomTicker);
|
|
1032
1124
|
|
|
1125
|
+
// src/decorators/LabelDecorator.ts
|
|
1126
|
+
var registeredLabels = {};
|
|
1127
|
+
function getLabelById(id) {
|
|
1128
|
+
let label = registeredLabels[id];
|
|
1129
|
+
if (!label) {
|
|
1130
|
+
console.error(`[Pixi'VN] Label ${id} not found`);
|
|
1131
|
+
return;
|
|
1132
|
+
}
|
|
1133
|
+
return label;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1033
1136
|
// src/functions/ExportUtility.ts
|
|
1034
1137
|
function createExportableElement(element) {
|
|
1035
1138
|
try {
|