@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
|
@@ -58,7 +58,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
// src/constants.ts
|
|
61
|
-
var PIXIVN_VERSION = "0.6.
|
|
61
|
+
var PIXIVN_VERSION = "0.6.7";
|
|
62
62
|
var Repeat = "repeat";
|
|
63
63
|
function getStepSha1(step) {
|
|
64
64
|
let sha1String = sha1__default.default(step.toString().toLocaleLowerCase());
|
|
@@ -68,16 +68,14 @@ function checkIfStepsIsEqual(step1, step2) {
|
|
|
68
68
|
return step1 === step2;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
// src/classes/
|
|
72
|
-
var
|
|
71
|
+
// src/classes/LabelAbstract.ts
|
|
72
|
+
var LabelAbstract = class {
|
|
73
73
|
/**
|
|
74
74
|
* @param id is the id of the label
|
|
75
|
-
* @param steps is the list of steps that the label will perform
|
|
76
75
|
* @param props is the properties of the label
|
|
77
76
|
*/
|
|
78
|
-
constructor(id,
|
|
77
|
+
constructor(id, props) {
|
|
79
78
|
this._id = id;
|
|
80
|
-
this._steps = steps;
|
|
81
79
|
this._onStepStart = props == null ? void 0 : props.onStepStart;
|
|
82
80
|
this._onLoadStep = props == null ? void 0 : props.onLoadStep;
|
|
83
81
|
this._onStepEnd = props == null ? void 0 : props.onStepEnd;
|
|
@@ -89,17 +87,6 @@ var Label = class {
|
|
|
89
87
|
get id() {
|
|
90
88
|
return this._id;
|
|
91
89
|
}
|
|
92
|
-
/**
|
|
93
|
-
* Get the steps of the label.
|
|
94
|
-
* This class should be extended and the steps method should be overridden.
|
|
95
|
-
* Every time you update this list will also be updated when the other game versions load.
|
|
96
|
-
*/
|
|
97
|
-
get steps() {
|
|
98
|
-
if (typeof this._steps === "function") {
|
|
99
|
-
return this._steps();
|
|
100
|
-
}
|
|
101
|
-
return this._steps;
|
|
102
|
-
}
|
|
103
90
|
/**
|
|
104
91
|
* Get the corresponding steps number
|
|
105
92
|
* @param externalSteps
|
|
@@ -150,6 +137,28 @@ var Label = class {
|
|
|
150
137
|
}
|
|
151
138
|
};
|
|
152
139
|
|
|
140
|
+
// src/classes/Label.ts
|
|
141
|
+
var Label = class extends LabelAbstract {
|
|
142
|
+
/**
|
|
143
|
+
* @param id is the id of the label
|
|
144
|
+
* @param steps is the list of steps that the label will perform
|
|
145
|
+
* @param props is the properties of the label
|
|
146
|
+
*/
|
|
147
|
+
constructor(id, steps, props) {
|
|
148
|
+
super(id, props);
|
|
149
|
+
this._steps = steps;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Get the steps of the label.
|
|
153
|
+
*/
|
|
154
|
+
get steps() {
|
|
155
|
+
if (typeof this._steps === "function") {
|
|
156
|
+
return this._steps();
|
|
157
|
+
}
|
|
158
|
+
return this._steps;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
|
|
153
162
|
// src/classes/CloseLabel.ts
|
|
154
163
|
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
155
164
|
function newCloseLabel(choiseIndex) {
|
|
@@ -671,16 +680,105 @@ function geTickerInstanceById(tickerId, args, duration, priority) {
|
|
|
671
680
|
// src/types/CloseType.ts
|
|
672
681
|
var Close = "close";
|
|
673
682
|
|
|
674
|
-
// src/
|
|
675
|
-
var
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
683
|
+
// src/classes/ChoiceMenuOption.ts
|
|
684
|
+
var ChoiceMenuOption = class {
|
|
685
|
+
/**
|
|
686
|
+
* @param text Text to be displayed in the menu
|
|
687
|
+
* @param label Label to be opened when the option is selected or the id of the label
|
|
688
|
+
* @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.
|
|
689
|
+
* @param type Type of the label to be opened. @default "call"
|
|
690
|
+
*/
|
|
691
|
+
constructor(text, label, props, type = "call") {
|
|
692
|
+
/**
|
|
693
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
694
|
+
* @example
|
|
695
|
+
* ```tsx
|
|
696
|
+
* setChoiceMenuOptions([
|
|
697
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
698
|
+
* ])
|
|
699
|
+
* return <List>
|
|
700
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
701
|
+
* return (
|
|
702
|
+
* <ChoiceButton
|
|
703
|
+
* disabled={item.props.disabled}
|
|
704
|
+
* onClick={() => {
|
|
705
|
+
* afterSelectChoice(item)
|
|
706
|
+
* }}
|
|
707
|
+
* >
|
|
708
|
+
* {item.text}
|
|
709
|
+
* </ChoiceButton>
|
|
710
|
+
* )
|
|
711
|
+
* })}
|
|
712
|
+
* </List>
|
|
713
|
+
* ```
|
|
714
|
+
*/
|
|
715
|
+
this.props = {};
|
|
716
|
+
this.text = text;
|
|
717
|
+
this._label = label;
|
|
718
|
+
this.type = type;
|
|
719
|
+
if (props) {
|
|
720
|
+
this.props = props;
|
|
721
|
+
}
|
|
681
722
|
}
|
|
682
|
-
|
|
683
|
-
|
|
723
|
+
/**
|
|
724
|
+
* Label to be opened when the option is selected
|
|
725
|
+
*/
|
|
726
|
+
get label() {
|
|
727
|
+
let label = this._label;
|
|
728
|
+
if (typeof label === "string") {
|
|
729
|
+
let res = getLabelById(label);
|
|
730
|
+
if (res) {
|
|
731
|
+
label = res;
|
|
732
|
+
} else {
|
|
733
|
+
console.error(`Label ${label} not found, so it will be closed`);
|
|
734
|
+
label = newCloseLabel();
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
return label;
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
var ChoiceMenuOptionClose = class {
|
|
741
|
+
/**
|
|
742
|
+
* @param text Text to be displayed in the menu
|
|
743
|
+
* @param closeCurrentLabel If true, the current label will be closed. @default false
|
|
744
|
+
*/
|
|
745
|
+
constructor(text, closeCurrentLabel = false) {
|
|
746
|
+
/**
|
|
747
|
+
* Label to be opened when the option is selected
|
|
748
|
+
*/
|
|
749
|
+
this.label = newCloseLabel();
|
|
750
|
+
/**
|
|
751
|
+
* Type of the label to be opened
|
|
752
|
+
*/
|
|
753
|
+
this.type = Close;
|
|
754
|
+
/**
|
|
755
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
756
|
+
* @example
|
|
757
|
+
* ```tsx
|
|
758
|
+
* setChoiceMenuOptions([
|
|
759
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
760
|
+
* ])
|
|
761
|
+
* return <List>
|
|
762
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
763
|
+
* return (
|
|
764
|
+
* <ChoiceButton
|
|
765
|
+
* disabled={item.props.disabled}
|
|
766
|
+
* onClick={() => {
|
|
767
|
+
* afterSelectChoice(item)
|
|
768
|
+
* }}
|
|
769
|
+
* >
|
|
770
|
+
* {item.text}
|
|
771
|
+
* </ChoiceButton>
|
|
772
|
+
* )
|
|
773
|
+
* })}
|
|
774
|
+
* </List>
|
|
775
|
+
* ```
|
|
776
|
+
*/
|
|
777
|
+
this.props = {};
|
|
778
|
+
this.text = text;
|
|
779
|
+
this.closeCurrentLabel = closeCurrentLabel;
|
|
780
|
+
}
|
|
781
|
+
};
|
|
684
782
|
|
|
685
783
|
// src/functions/DialogueUtility.ts
|
|
686
784
|
function getDialogue() {
|
|
@@ -693,13 +791,9 @@ function getChoiceMenuOptions() {
|
|
|
693
791
|
d.forEach((option, index) => {
|
|
694
792
|
if (option.type === Close) {
|
|
695
793
|
let itemLabel = newCloseLabel(index);
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
type: Close,
|
|
700
|
-
closeCurrentLabel: option.closeCurrentLabel,
|
|
701
|
-
props: {}
|
|
702
|
-
});
|
|
794
|
+
let choice = new ChoiceMenuOptionClose(option.text, option.closeCurrentLabel);
|
|
795
|
+
choice.label = itemLabel;
|
|
796
|
+
options.push(choice);
|
|
703
797
|
return;
|
|
704
798
|
}
|
|
705
799
|
let label = getLabelById(option.label);
|
|
@@ -708,9 +802,7 @@ function getChoiceMenuOptions() {
|
|
|
708
802
|
onStepStart: label.onStepStart,
|
|
709
803
|
choiseIndex: index
|
|
710
804
|
});
|
|
711
|
-
options.push(
|
|
712
|
-
label: itemLabel
|
|
713
|
-
}));
|
|
805
|
+
options.push(new ChoiceMenuOption(option.text, itemLabel, option.props, option.type));
|
|
714
806
|
}
|
|
715
807
|
});
|
|
716
808
|
return options;
|
|
@@ -1036,6 +1128,17 @@ ZoomTicker = __decorateClass([
|
|
|
1036
1128
|
tickerDecorator()
|
|
1037
1129
|
], ZoomTicker);
|
|
1038
1130
|
|
|
1131
|
+
// src/decorators/LabelDecorator.ts
|
|
1132
|
+
var registeredLabels = {};
|
|
1133
|
+
function getLabelById(id) {
|
|
1134
|
+
let label = registeredLabels[id];
|
|
1135
|
+
if (!label) {
|
|
1136
|
+
console.error(`[Pixi'VN] Label ${id} not found`);
|
|
1137
|
+
return;
|
|
1138
|
+
}
|
|
1139
|
+
return label;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1039
1142
|
// src/functions/ExportUtility.ts
|
|
1040
1143
|
function createExportableElement(element) {
|
|
1041
1144
|
try {
|