@drincs/pixi-vn 0.6.4 → 0.6.6
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 +56 -7
- package/dist/classes/CharacterBaseModel.js +99 -90
- package/dist/classes/CharacterBaseModel.js.map +1 -1
- package/dist/classes/CharacterBaseModel.mjs +99 -90
- package/dist/classes/CharacterBaseModel.mjs.map +1 -1
- package/dist/classes/ChoiceMenuOption.d.mts +71 -8
- package/dist/classes/ChoiceMenuOption.d.ts +71 -8
- package/dist/classes/ChoiceMenuOption.js +160 -77
- package/dist/classes/ChoiceMenuOption.js.map +1 -1
- package/dist/classes/ChoiceMenuOption.mjs +160 -77
- 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 +77 -32
- package/dist/classes/CloseLabel.js.map +1 -1
- package/dist/classes/CloseLabel.mjs +77 -32
- package/dist/classes/CloseLabel.mjs.map +1 -1
- package/dist/classes/Label.d.mts +6 -33
- package/dist/classes/Label.d.ts +6 -33
- package/dist/classes/Label.js +74 -31
- package/dist/classes/Label.js.map +1 -1
- package/dist/classes/Label.mjs +74 -31
- 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 +42 -33
- package/dist/classes/StoredClassModel.js.map +1 -1
- package/dist/classes/StoredClassModel.mjs +42 -33
- package/dist/classes/StoredClassModel.mjs.map +1 -1
- package/dist/classes/canvas/CanvasContainer.js +2 -2
- package/dist/classes/canvas/CanvasContainer.js.map +1 -1
- package/dist/classes/canvas/CanvasContainer.mjs +2 -2
- package/dist/classes/canvas/CanvasContainer.mjs.map +1 -1
- package/dist/classes/canvas/CanvasImage.js +2 -2
- package/dist/classes/canvas/CanvasImage.js.map +1 -1
- package/dist/classes/canvas/CanvasImage.mjs +2 -2
- package/dist/classes/canvas/CanvasImage.mjs.map +1 -1
- package/dist/classes/canvas/CanvasSprite.js +2 -2
- package/dist/classes/canvas/CanvasSprite.js.map +1 -1
- package/dist/classes/canvas/CanvasSprite.mjs +2 -2
- package/dist/classes/canvas/CanvasSprite.mjs.map +1 -1
- package/dist/classes/canvas/CanvasText.js +2 -2
- package/dist/classes/canvas/CanvasText.js.map +1 -1
- package/dist/classes/canvas/CanvasText.mjs +2 -2
- package/dist/classes/canvas/CanvasText.mjs.map +1 -1
- package/dist/classes/canvas/index.js +2 -2
- package/dist/classes/canvas/index.js.map +1 -1
- package/dist/classes/canvas/index.mjs +2 -2
- package/dist/classes/canvas/index.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 +945 -78
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +945 -79
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.js +42 -33
- package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.mjs +42 -33
- package/dist/classes/ticker/FadeAlphaTicker.mjs.map +1 -1
- package/dist/classes/ticker/MoveTicker.d.mts +1 -0
- package/dist/classes/ticker/MoveTicker.d.ts +1 -0
- package/dist/classes/ticker/MoveTicker.js +42 -33
- package/dist/classes/ticker/MoveTicker.js.map +1 -1
- package/dist/classes/ticker/MoveTicker.mjs +42 -33
- package/dist/classes/ticker/MoveTicker.mjs.map +1 -1
- package/dist/classes/ticker/RotateTicker.d.mts +1 -0
- package/dist/classes/ticker/RotateTicker.d.ts +1 -0
- package/dist/classes/ticker/RotateTicker.js +42 -33
- package/dist/classes/ticker/RotateTicker.js.map +1 -1
- package/dist/classes/ticker/RotateTicker.mjs +42 -33
- package/dist/classes/ticker/RotateTicker.mjs.map +1 -1
- package/dist/classes/ticker/ZoomTicker.d.mts +1 -0
- package/dist/classes/ticker/ZoomTicker.d.ts +1 -0
- package/dist/classes/ticker/ZoomTicker.js +42 -33
- package/dist/classes/ticker/ZoomTicker.js.map +1 -1
- package/dist/classes/ticker/ZoomTicker.mjs +42 -33
- package/dist/classes/ticker/ZoomTicker.mjs.map +1 -1
- package/dist/classes/ticker/index.js +42 -33
- package/dist/classes/ticker/index.js.map +1 -1
- package/dist/classes/ticker/index.mjs +42 -33
- 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/CanvasElementDecorator.js +2 -2
- package/dist/decorators/CanvasElementDecorator.js.map +1 -1
- package/dist/decorators/CanvasElementDecorator.mjs +2 -2
- package/dist/decorators/CanvasElementDecorator.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 +102 -65
- package/dist/decorators/LabelDecorator.js.map +1 -1
- package/dist/decorators/LabelDecorator.mjs +102 -66
- 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 +98 -65
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +98 -65
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/CanvasUtility.js +2 -2
- package/dist/functions/CanvasUtility.js.map +1 -1
- package/dist/functions/CanvasUtility.mjs +2 -2
- package/dist/functions/CanvasUtility.mjs.map +1 -1
- package/dist/functions/DialogueUtility.d.mts +10 -8
- package/dist/functions/DialogueUtility.d.ts +10 -8
- package/dist/functions/DialogueUtility.js +268 -131
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +268 -131
- package/dist/functions/DialogueUtility.mjs.map +1 -1
- package/dist/functions/FlagsUtility.js +42 -33
- package/dist/functions/FlagsUtility.js.map +1 -1
- package/dist/functions/FlagsUtility.mjs +42 -33
- package/dist/functions/FlagsUtility.mjs.map +1 -1
- package/dist/functions/GameUtility.js +42 -33
- package/dist/functions/GameUtility.js.map +1 -1
- package/dist/functions/GameUtility.mjs +42 -33
- package/dist/functions/GameUtility.mjs.map +1 -1
- package/dist/functions/ImageUtility.js +45 -36
- package/dist/functions/ImageUtility.js.map +1 -1
- package/dist/functions/ImageUtility.mjs +45 -36
- 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 +5 -3
- package/dist/functions/SavesUtility.d.ts +5 -3
- package/dist/functions/SavesUtility.js +310 -145
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +310 -145
- package/dist/functions/SavesUtility.mjs.map +1 -1
- package/dist/functions/TickerUtility.d.mts +2 -1
- package/dist/functions/TickerUtility.d.ts +2 -1
- package/dist/functions/TickerUtility.js +19 -15
- package/dist/functions/TickerUtility.js.map +1 -1
- package/dist/functions/TickerUtility.mjs +19 -15
- package/dist/functions/TickerUtility.mjs.map +1 -1
- package/dist/functions/index.d.mts +7 -2
- package/dist/functions/index.d.ts +7 -2
- package/dist/functions/index.js +364 -140
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +364 -141
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +453 -219
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +453 -221
- 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 -0
- package/dist/interface/LabelProps.d.ts +38 -0
- package/dist/interface/LabelProps.js +4 -0
- package/dist/interface/LabelProps.js.map +1 -0
- package/dist/interface/LabelProps.mjs +3 -0
- package/dist/interface/LabelProps.mjs.map +1 -0
- 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 +3 -1
- package/dist/interface/index.d.ts +3 -1
- package/dist/labels/BaseCanvasElementTestLabel.d.mts +3 -1
- package/dist/labels/BaseCanvasElementTestLabel.d.ts +3 -1
- package/dist/labels/BaseCanvasElementTestLabel.js +303 -136
- package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/BaseCanvasElementTestLabel.mjs +304 -137
- package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -1
- package/dist/labels/CanvasEventsTestLabel.d.mts +4 -5
- package/dist/labels/CanvasEventsTestLabel.d.ts +4 -5
- package/dist/labels/CanvasEventsTestLabel.js +313 -148
- package/dist/labels/CanvasEventsTestLabel.js.map +1 -1
- package/dist/labels/CanvasEventsTestLabel.mjs +314 -149
- 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 +294 -133
- package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs +295 -134
- 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 +298 -181
- package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -1
- package/dist/labels/ImagesAnimationsTestLabel.mjs +299 -182
- 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 +294 -133
- package/dist/labels/MarkdownTest.js.map +1 -1
- package/dist/labels/MarkdownTest.mjs +294 -133
- 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 +360 -213
- package/dist/labels/StartLabel.js.map +1 -1
- package/dist/labels/StartLabel.mjs +361 -214
- package/dist/labels/StartLabel.mjs.map +1 -1
- package/dist/labels/StepLabelTest.d.mts +11 -0
- package/dist/labels/StepLabelTest.d.ts +11 -0
- package/dist/labels/StepLabelTest.js +2861 -0
- package/dist/labels/StepLabelTest.js.map +1 -0
- package/dist/labels/StepLabelTest.mjs +2855 -0
- package/dist/labels/StepLabelTest.mjs.map +1 -0
- package/dist/labels/TestConstant.js +43 -34
- package/dist/labels/TestConstant.js.map +1 -1
- package/dist/labels/TestConstant.mjs +43 -34
- 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 +360 -213
- package/dist/labels/index.js.map +1 -1
- package/dist/labels/index.mjs +361 -214
- package/dist/labels/index.mjs.map +1 -1
- package/dist/managers/StepManager.d.mts +10 -7
- package/dist/managers/StepManager.d.ts +10 -7
- package/dist/managers/StepManager.js +300 -139
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +300 -139
- package/dist/managers/StepManager.mjs.map +1 -1
- package/dist/managers/WindowManager.js +2 -2
- package/dist/managers/WindowManager.js.map +1 -1
- package/dist/managers/WindowManager.mjs +2 -2
- 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 +300 -139
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +300 -139
- 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 +4 -0
- package/dist/types/index.d.ts +4 -0
- package/package.json +7 -6
|
@@ -58,19 +58,18 @@ function checkIfStepsIsEqual(step1, step2) {
|
|
|
58
58
|
return step1 === step2;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
// src/classes/
|
|
62
|
-
var
|
|
61
|
+
// src/classes/LabelAbstract.ts
|
|
62
|
+
var LabelAbstract = class {
|
|
63
63
|
/**
|
|
64
64
|
* @param id is the id of the label
|
|
65
|
-
* @param
|
|
66
|
-
* @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
|
|
67
|
-
* @param choiseIndex is the index of the choice that the label will perform
|
|
65
|
+
* @param props is the properties of the label
|
|
68
66
|
*/
|
|
69
|
-
constructor(id,
|
|
67
|
+
constructor(id, props) {
|
|
70
68
|
this._id = id;
|
|
71
|
-
this.
|
|
72
|
-
this.
|
|
73
|
-
this.
|
|
69
|
+
this._onStepStart = props == null ? void 0 : props.onStepStart;
|
|
70
|
+
this._onLoadStep = props == null ? void 0 : props.onLoadStep;
|
|
71
|
+
this._onStepEnd = props == null ? void 0 : props.onStepEnd;
|
|
72
|
+
this._choiseIndex = props == null ? void 0 : props.choiseIndex;
|
|
74
73
|
}
|
|
75
74
|
/**
|
|
76
75
|
* Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
|
|
@@ -78,17 +77,6 @@ var Label = class {
|
|
|
78
77
|
get id() {
|
|
79
78
|
return this._id;
|
|
80
79
|
}
|
|
81
|
-
/**
|
|
82
|
-
* Get the steps of the label.
|
|
83
|
-
* This class should be extended and the steps method should be overridden.
|
|
84
|
-
* Every time you update this list will also be updated when the other game versions load.
|
|
85
|
-
*/
|
|
86
|
-
get steps() {
|
|
87
|
-
if (typeof this._steps === "function") {
|
|
88
|
-
return this._steps();
|
|
89
|
-
}
|
|
90
|
-
return this._steps;
|
|
91
|
-
}
|
|
92
80
|
/**
|
|
93
81
|
* Get the corresponding steps number
|
|
94
82
|
* @param externalSteps
|
|
@@ -107,28 +95,66 @@ var Label = class {
|
|
|
107
95
|
return res;
|
|
108
96
|
}
|
|
109
97
|
/**
|
|
110
|
-
*
|
|
98
|
+
* Is a function that will be executed in {@link Label#onStepStart} and when the user goes back to it or when the user laods a save file.
|
|
111
99
|
* @returns Promise<void> or void
|
|
112
|
-
* @example
|
|
113
|
-
* ```typescript
|
|
114
|
-
* newLabel("id", [], () => {
|
|
115
|
-
* Assets.load('path/to/image1.png')
|
|
116
|
-
* Assets.load('path/to/image2.png')
|
|
117
|
-
* })
|
|
118
|
-
* ```
|
|
119
100
|
*/
|
|
120
|
-
get
|
|
121
|
-
return this
|
|
101
|
+
get onStepStart() {
|
|
102
|
+
return (stepIndex, label) => __async(this, null, function* () {
|
|
103
|
+
if (this._onLoadStep) {
|
|
104
|
+
yield this._onLoadStep(stepIndex, label);
|
|
105
|
+
}
|
|
106
|
+
if (this._onStepStart) {
|
|
107
|
+
return yield this._onStepStart(stepIndex, label);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Get the function that will be executed a old step is reloaded. A step is reloaded when the user goes back to it or when the user laods a save file.
|
|
113
|
+
* @returns Promise<void> or void
|
|
114
|
+
*/
|
|
115
|
+
get onLoadStep() {
|
|
116
|
+
return this._onLoadStep;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Is a function that will be executed when the step ends.
|
|
120
|
+
* @returns Promise<void> or void
|
|
121
|
+
*/
|
|
122
|
+
get onStepEnd() {
|
|
123
|
+
return this._onStepEnd;
|
|
122
124
|
}
|
|
123
125
|
get choiseIndex() {
|
|
124
126
|
return this._choiseIndex;
|
|
125
127
|
}
|
|
126
128
|
};
|
|
127
129
|
|
|
130
|
+
// src/classes/Label.ts
|
|
131
|
+
var Label = class extends LabelAbstract {
|
|
132
|
+
/**
|
|
133
|
+
* @param id is the id of the label
|
|
134
|
+
* @param steps is the list of steps that the label will perform
|
|
135
|
+
* @param props is the properties of the label
|
|
136
|
+
*/
|
|
137
|
+
constructor(id, steps, props) {
|
|
138
|
+
super(id, props);
|
|
139
|
+
this._steps = steps;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Get the steps of the label.
|
|
143
|
+
*/
|
|
144
|
+
get steps() {
|
|
145
|
+
if (typeof this._steps === "function") {
|
|
146
|
+
return this._steps();
|
|
147
|
+
}
|
|
148
|
+
return this._steps;
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
128
152
|
// src/classes/CloseLabel.ts
|
|
129
153
|
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
130
154
|
function newCloseLabel(choiseIndex) {
|
|
131
|
-
return new Label(CLOSE_LABEL_ID, [],
|
|
155
|
+
return new Label(CLOSE_LABEL_ID, [], {
|
|
156
|
+
choiseIndex
|
|
157
|
+
});
|
|
132
158
|
}
|
|
133
159
|
|
|
134
160
|
// src/decorators/LabelDecorator.ts
|
|
@@ -588,8 +614,6 @@ function getMemoryContainer(element) {
|
|
|
588
614
|
};
|
|
589
615
|
}
|
|
590
616
|
function setMemoryContainer(element, memory) {
|
|
591
|
-
memory.width && (element.width = memory.width);
|
|
592
|
-
memory.height && (element.height = memory.height);
|
|
593
617
|
memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
|
|
594
618
|
memory.blendMode && (element.blendMode = memory.blendMode);
|
|
595
619
|
memory.tint && (element.tint = memory.tint);
|
|
@@ -622,6 +646,8 @@ function setMemoryContainer(element, memory) {
|
|
|
622
646
|
memory.interactive && (element.interactive = memory.interactive);
|
|
623
647
|
memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
|
|
624
648
|
memory.hitArea && (element.hitArea = memory.hitArea);
|
|
649
|
+
memory.width && (element.width = memory.width);
|
|
650
|
+
memory.height && (element.height = memory.height);
|
|
625
651
|
}
|
|
626
652
|
|
|
627
653
|
// src/decorators/TickerDecorator.ts
|
|
@@ -732,8 +758,9 @@ FadeAlphaTicker = __decorateClass([
|
|
|
732
758
|
], FadeAlphaTicker);
|
|
733
759
|
|
|
734
760
|
// src/functions/TickerUtility.ts
|
|
735
|
-
function updateTickerProgression(args, propertyName, progression) {
|
|
736
|
-
|
|
761
|
+
function updateTickerProgression(args, propertyName, progression, valueConvert) {
|
|
762
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
763
|
+
if (args[propertyName] === void 0 || !progression || args[propertyName] === limit) {
|
|
737
764
|
return;
|
|
738
765
|
}
|
|
739
766
|
if (typeof args[propertyName] === "number") {
|
|
@@ -752,22 +779,25 @@ function updateTickerProgression(args, propertyName, progression) {
|
|
|
752
779
|
}
|
|
753
780
|
}
|
|
754
781
|
}
|
|
755
|
-
function getLinearProgression(number, progression) {
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
return
|
|
782
|
+
function getLinearProgression(number, progression, valueConvert) {
|
|
783
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
784
|
+
let amt = valueConvert ? valueConvert(progression.amt) : progression.amt;
|
|
785
|
+
if (limit !== void 0) {
|
|
786
|
+
if (number > limit && amt > 0) {
|
|
787
|
+
return limit;
|
|
788
|
+
} else if (number < limit && amt < 0) {
|
|
789
|
+
return limit;
|
|
761
790
|
}
|
|
762
791
|
}
|
|
763
|
-
return number +
|
|
792
|
+
return number + amt;
|
|
764
793
|
}
|
|
765
|
-
function getExponentialProgression(number, progression) {
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
794
|
+
function getExponentialProgression(number, progression, valueConvert) {
|
|
795
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
796
|
+
if (limit !== void 0) {
|
|
797
|
+
if (number > limit && progression.percentage > 0) {
|
|
798
|
+
return limit;
|
|
799
|
+
} else if (number < limit && progression.percentage < 0) {
|
|
800
|
+
return limit;
|
|
771
801
|
}
|
|
772
802
|
}
|
|
773
803
|
return number + number * progression.percentage;
|
|
@@ -780,15 +810,13 @@ var MoveTicker = class extends TickerBase {
|
|
|
780
810
|
let ySpeed = 1;
|
|
781
811
|
if (args.speed) {
|
|
782
812
|
if (typeof args.speed === "number") {
|
|
783
|
-
xSpeed = args.speed;
|
|
784
|
-
ySpeed = args.speed;
|
|
813
|
+
xSpeed = this.speedConvert(args.speed);
|
|
814
|
+
ySpeed = this.speedConvert(args.speed);
|
|
785
815
|
} else {
|
|
786
|
-
xSpeed = args.speed.x;
|
|
787
|
-
ySpeed = args.speed.y;
|
|
816
|
+
xSpeed = this.speedConvert(args.speed.x);
|
|
817
|
+
ySpeed = this.speedConvert(args.speed.y);
|
|
788
818
|
}
|
|
789
819
|
}
|
|
790
|
-
xSpeed /= 60;
|
|
791
|
-
ySpeed /= 60;
|
|
792
820
|
let destination = args.destination;
|
|
793
821
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
794
822
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
@@ -828,7 +856,10 @@ var MoveTicker = class extends TickerBase {
|
|
|
828
856
|
}
|
|
829
857
|
});
|
|
830
858
|
if (args.speedProgression)
|
|
831
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
859
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
860
|
+
}
|
|
861
|
+
speedConvert(speed) {
|
|
862
|
+
return speed / 6;
|
|
832
863
|
}
|
|
833
864
|
};
|
|
834
865
|
MoveTicker = __decorateClass([
|
|
@@ -836,7 +867,7 @@ MoveTicker = __decorateClass([
|
|
|
836
867
|
], MoveTicker);
|
|
837
868
|
var RotateTicker = class extends TickerBase {
|
|
838
869
|
fn(ticker, args, tags, tickerId) {
|
|
839
|
-
let speed = (args.speed === void 0 ? 1 : args.speed)
|
|
870
|
+
let speed = this.speedConvert(args.speed === void 0 ? 1 : args.speed);
|
|
840
871
|
let clockwise = args.clockwise === void 0 ? true : args.clockwise;
|
|
841
872
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
842
873
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
@@ -864,7 +895,10 @@ var RotateTicker = class extends TickerBase {
|
|
|
864
895
|
}
|
|
865
896
|
});
|
|
866
897
|
if (args.speedProgression)
|
|
867
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
898
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
899
|
+
}
|
|
900
|
+
speedConvert(speed) {
|
|
901
|
+
return speed / 60;
|
|
868
902
|
}
|
|
869
903
|
};
|
|
870
904
|
RotateTicker = __decorateClass([
|
|
@@ -876,15 +910,13 @@ var ZoomTicker = class extends TickerBase {
|
|
|
876
910
|
let ySpeed = 0.1;
|
|
877
911
|
if (args.speed) {
|
|
878
912
|
if (typeof args.speed === "number") {
|
|
879
|
-
xSpeed = args.speed;
|
|
880
|
-
ySpeed = args.speed;
|
|
913
|
+
xSpeed = this.speedConvert(args.speed);
|
|
914
|
+
ySpeed = this.speedConvert(args.speed);
|
|
881
915
|
} else {
|
|
882
|
-
xSpeed = args.speed.x;
|
|
883
|
-
ySpeed = args.speed.y;
|
|
916
|
+
xSpeed = this.speedConvert(args.speed.x);
|
|
917
|
+
ySpeed = this.speedConvert(args.speed.y);
|
|
884
918
|
}
|
|
885
919
|
}
|
|
886
|
-
xSpeed /= 60;
|
|
887
|
-
ySpeed /= 60;
|
|
888
920
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
889
921
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
890
922
|
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
@@ -951,7 +983,10 @@ var ZoomTicker = class extends TickerBase {
|
|
|
951
983
|
}
|
|
952
984
|
});
|
|
953
985
|
if (args.speedProgression)
|
|
954
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
986
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
987
|
+
}
|
|
988
|
+
speedConvert(speed) {
|
|
989
|
+
return speed / 60;
|
|
955
990
|
}
|
|
956
991
|
onEndOfTicker(tag, tickerId, _element, tagToRemoveAfter2) {
|
|
957
992
|
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
@@ -1913,6 +1948,16 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1913
1948
|
static set originalStepData(value) {
|
|
1914
1949
|
_GameStepManager._originalStepData = createExportableElement(value);
|
|
1915
1950
|
}
|
|
1951
|
+
static get currentStepData() {
|
|
1952
|
+
let currentStepData = {
|
|
1953
|
+
path: window.location.pathname,
|
|
1954
|
+
storage: GameStorageManager.export(),
|
|
1955
|
+
canvas: GameWindowManager.export(),
|
|
1956
|
+
labelIndex: _GameStepManager.currentLabelStepIndex || 0,
|
|
1957
|
+
openedLabels: createExportableElement(_GameStepManager._openedLabels)
|
|
1958
|
+
};
|
|
1959
|
+
return currentStepData;
|
|
1960
|
+
}
|
|
1916
1961
|
/* Edit History Methods */
|
|
1917
1962
|
/**
|
|
1918
1963
|
* Add a label to the history.
|
|
@@ -1920,19 +1965,13 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1920
1965
|
*/
|
|
1921
1966
|
static addStepHistory(step, choiseMade) {
|
|
1922
1967
|
let stepHistory = getStepSha1(step);
|
|
1923
|
-
let
|
|
1924
|
-
path: window.location.pathname,
|
|
1925
|
-
storage: GameStorageManager.export(),
|
|
1926
|
-
canvas: GameWindowManager.export(),
|
|
1927
|
-
labelIndex: _GameStepManager.currentLabelStepIndex || 0,
|
|
1928
|
-
openedLabels: createExportableElement(_GameStepManager._openedLabels)
|
|
1929
|
-
};
|
|
1968
|
+
let currentStepData = _GameStepManager.currentStepData;
|
|
1930
1969
|
if (_GameStepManager.originalStepData) {
|
|
1931
|
-
if (_GameStepManager.originalStepData.openedLabels.length ===
|
|
1970
|
+
if (_GameStepManager.originalStepData.openedLabels.length === currentStepData.openedLabels.length) {
|
|
1932
1971
|
try {
|
|
1933
1972
|
let lastStepDataOpenedLabelsString = JSON.stringify(_GameStepManager.originalStepData.openedLabels);
|
|
1934
|
-
let historyStepOpenedLabelsString = JSON.stringify(
|
|
1935
|
-
if (lastStepDataOpenedLabelsString === historyStepOpenedLabelsString && _GameStepManager.originalStepData.path ===
|
|
1973
|
+
let historyStepOpenedLabelsString = JSON.stringify(currentStepData.openedLabels);
|
|
1974
|
+
if (lastStepDataOpenedLabelsString === historyStepOpenedLabelsString && _GameStepManager.originalStepData.path === currentStepData.path && _GameStepManager.originalStepData.labelIndex === currentStepData.labelIndex) {
|
|
1936
1975
|
return;
|
|
1937
1976
|
}
|
|
1938
1977
|
} catch (e) {
|
|
@@ -1940,7 +1979,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1940
1979
|
}
|
|
1941
1980
|
}
|
|
1942
1981
|
}
|
|
1943
|
-
let data = diff(_GameStepManager.originalStepData,
|
|
1982
|
+
let data = diff(_GameStepManager.originalStepData, currentStepData);
|
|
1944
1983
|
if (data) {
|
|
1945
1984
|
let dialoge = void 0;
|
|
1946
1985
|
let requiredChoices = void 0;
|
|
@@ -1959,7 +1998,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1959
1998
|
index: _GameStepManager.lastStepIndex,
|
|
1960
1999
|
choiceIndexMade: choiseMade
|
|
1961
2000
|
});
|
|
1962
|
-
_GameStepManager.originalStepData =
|
|
2001
|
+
_GameStepManager.originalStepData = currentStepData;
|
|
1963
2002
|
}
|
|
1964
2003
|
_GameStepManager.increaseLastStepIndex();
|
|
1965
2004
|
}
|
|
@@ -2050,6 +2089,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2050
2089
|
console.warn("[Pixi'VN] The player must make a choice");
|
|
2051
2090
|
return;
|
|
2052
2091
|
}
|
|
2092
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2093
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2094
|
+
}
|
|
2053
2095
|
_GameStepManager.increaseCurrentStepIndex();
|
|
2054
2096
|
return yield _GameStepManager.runCurrentStep(props, choiseMade);
|
|
2055
2097
|
});
|
|
@@ -2074,6 +2116,10 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2074
2116
|
return;
|
|
2075
2117
|
}
|
|
2076
2118
|
if (currentLabel.steps.length > currentLabelStepIndex) {
|
|
2119
|
+
let onStepRun = currentLabel.onStepStart;
|
|
2120
|
+
if (onStepRun) {
|
|
2121
|
+
yield onStepRun(currentLabelStepIndex, currentLabel);
|
|
2122
|
+
}
|
|
2077
2123
|
let step = currentLabel.steps[currentLabelStepIndex];
|
|
2078
2124
|
let result = yield step(props);
|
|
2079
2125
|
_GameStepManager.addStepHistory(step, choiseMade);
|
|
@@ -2138,6 +2184,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2138
2184
|
if (!tempLabel) {
|
|
2139
2185
|
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
2140
2186
|
}
|
|
2187
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2188
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2189
|
+
}
|
|
2141
2190
|
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
2142
2191
|
} catch (e) {
|
|
2143
2192
|
console.error("[Pixi'VN] Error calling label", e);
|
|
@@ -2196,6 +2245,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2196
2245
|
if (!tempLabel) {
|
|
2197
2246
|
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
2198
2247
|
}
|
|
2248
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2249
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2250
|
+
}
|
|
2199
2251
|
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
2200
2252
|
} catch (e) {
|
|
2201
2253
|
console.error("[Pixi'VN] Error jumping label", e);
|
|
@@ -2301,24 +2353,29 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2301
2353
|
* ```
|
|
2302
2354
|
*/
|
|
2303
2355
|
static goBack(navigate, steps = 1) {
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2356
|
+
return __async(this, null, function* () {
|
|
2357
|
+
if (steps <= 0) {
|
|
2358
|
+
console.warn("[Pixi'VN] Steps must be greater than 0");
|
|
2359
|
+
return;
|
|
2360
|
+
}
|
|
2361
|
+
if (_GameStepManager._stepsHistory.length <= 1) {
|
|
2362
|
+
console.warn("[Pixi'VN] No steps to go back");
|
|
2363
|
+
return;
|
|
2364
|
+
}
|
|
2365
|
+
let restoredStep = _GameStepManager.goBackInternal(steps, _GameStepManager.originalStepData);
|
|
2366
|
+
if (restoredStep) {
|
|
2367
|
+
_GameStepManager._originalStepData = restoredStep;
|
|
2368
|
+
_GameStepManager._openedLabels = createExportableElement(restoredStep.openedLabels);
|
|
2369
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onLoadStep) {
|
|
2370
|
+
yield _GameStepManager.currentLabel.onLoadStep(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2371
|
+
}
|
|
2372
|
+
GameStorageManager.import(createExportableElement(restoredStep.storage));
|
|
2373
|
+
GameWindowManager.import(createExportableElement(restoredStep.canvas));
|
|
2374
|
+
navigate(restoredStep.path);
|
|
2375
|
+
} else {
|
|
2376
|
+
console.error("[Pixi'VN] Error going back");
|
|
2377
|
+
}
|
|
2378
|
+
});
|
|
2322
2379
|
}
|
|
2323
2380
|
static goBackInternal(steps, restoredStep) {
|
|
2324
2381
|
if (steps <= 0) {
|
|
@@ -2380,38 +2437,45 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2380
2437
|
* @param dataString The history in a JSON string.
|
|
2381
2438
|
*/
|
|
2382
2439
|
static importJson(dataString) {
|
|
2383
|
-
|
|
2440
|
+
return __async(this, null, function* () {
|
|
2441
|
+
yield _GameStepManager.import(JSON.parse(dataString));
|
|
2442
|
+
});
|
|
2384
2443
|
}
|
|
2385
2444
|
/**
|
|
2386
2445
|
* Import the history from an object.
|
|
2387
2446
|
* @param data The history in an object.
|
|
2388
2447
|
*/
|
|
2389
2448
|
static import(data) {
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2449
|
+
return __async(this, null, function* () {
|
|
2450
|
+
_GameStepManager.clear();
|
|
2451
|
+
try {
|
|
2452
|
+
if (data.hasOwnProperty("stepsHistory")) {
|
|
2453
|
+
_GameStepManager._stepsHistory = data["stepsHistory"];
|
|
2454
|
+
} else {
|
|
2455
|
+
console.warn("[Pixi'VN] Could not import stepsHistory data, so will be ignored");
|
|
2456
|
+
}
|
|
2457
|
+
if (data.hasOwnProperty("openedLabels")) {
|
|
2458
|
+
_GameStepManager._openedLabels = data["openedLabels"];
|
|
2459
|
+
} else {
|
|
2460
|
+
console.warn("[Pixi'VN] Could not import openedLabels data, so will be ignored");
|
|
2461
|
+
}
|
|
2462
|
+
if (data.hasOwnProperty("lastStepIndex")) {
|
|
2463
|
+
_GameStepManager._lastStepIndex = data["lastStepIndex"];
|
|
2464
|
+
} else {
|
|
2465
|
+
console.warn("[Pixi'VN] Could not import lastStepIndex data, so will be ignored");
|
|
2466
|
+
}
|
|
2467
|
+
if (data.hasOwnProperty("originalStepData")) {
|
|
2468
|
+
_GameStepManager._originalStepData = data["originalStepData"];
|
|
2469
|
+
} else {
|
|
2470
|
+
console.warn("[Pixi'VN] Could not import originalStepData data, so will be ignored");
|
|
2471
|
+
}
|
|
2472
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onLoadStep) {
|
|
2473
|
+
yield _GameStepManager.currentLabel.onLoadStep(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2474
|
+
}
|
|
2475
|
+
} catch (e) {
|
|
2476
|
+
console.error("[Pixi'VN] Error importing data", e);
|
|
2411
2477
|
}
|
|
2412
|
-
}
|
|
2413
|
-
console.error("[Pixi'VN] Error importing data", e);
|
|
2414
|
-
}
|
|
2478
|
+
});
|
|
2415
2479
|
}
|
|
2416
2480
|
};
|
|
2417
2481
|
/**
|
|
@@ -2427,6 +2491,62 @@ var GameStepManager = _GameStepManager;
|
|
|
2427
2491
|
var Close = "close";
|
|
2428
2492
|
|
|
2429
2493
|
// src/classes/ChoiceMenuOption.ts
|
|
2494
|
+
var ChoiceMenuOption = class {
|
|
2495
|
+
/**
|
|
2496
|
+
* @param text Text to be displayed in the menu
|
|
2497
|
+
* @param label Label to be opened when the option is selected or the id of the label
|
|
2498
|
+
* @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.
|
|
2499
|
+
* @param type Type of the label to be opened. @default "call"
|
|
2500
|
+
*/
|
|
2501
|
+
constructor(text, label, props, type = "call") {
|
|
2502
|
+
/**
|
|
2503
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
2504
|
+
* @example
|
|
2505
|
+
* ```tsx
|
|
2506
|
+
* setChoiceMenuOptions([
|
|
2507
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
2508
|
+
* ])
|
|
2509
|
+
* return <List>
|
|
2510
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
2511
|
+
* return (
|
|
2512
|
+
* <ChoiceButton
|
|
2513
|
+
* disabled={item.props.disabled}
|
|
2514
|
+
* onClick={() => {
|
|
2515
|
+
* afterSelectChoice(item)
|
|
2516
|
+
* }}
|
|
2517
|
+
* >
|
|
2518
|
+
* {item.text}
|
|
2519
|
+
* </ChoiceButton>
|
|
2520
|
+
* )
|
|
2521
|
+
* })}
|
|
2522
|
+
* </List>
|
|
2523
|
+
* ```
|
|
2524
|
+
*/
|
|
2525
|
+
this.props = {};
|
|
2526
|
+
this.text = text;
|
|
2527
|
+
this._label = label;
|
|
2528
|
+
this.type = type;
|
|
2529
|
+
if (props) {
|
|
2530
|
+
this.props = props;
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
/**
|
|
2534
|
+
* Label to be opened when the option is selected
|
|
2535
|
+
*/
|
|
2536
|
+
get label() {
|
|
2537
|
+
let label = this._label;
|
|
2538
|
+
if (typeof label === "string") {
|
|
2539
|
+
let res = getLabelById(label);
|
|
2540
|
+
if (res) {
|
|
2541
|
+
label = res;
|
|
2542
|
+
} else {
|
|
2543
|
+
console.error(`Label ${label} not found, so it will be closed`);
|
|
2544
|
+
label = newCloseLabel();
|
|
2545
|
+
}
|
|
2546
|
+
}
|
|
2547
|
+
return label;
|
|
2548
|
+
}
|
|
2549
|
+
};
|
|
2430
2550
|
var ChoiceMenuOptionClose = class {
|
|
2431
2551
|
/**
|
|
2432
2552
|
* @param text Text to be displayed in the menu
|
|
@@ -2442,7 +2562,27 @@ var ChoiceMenuOptionClose = class {
|
|
|
2442
2562
|
*/
|
|
2443
2563
|
this.type = Close;
|
|
2444
2564
|
/**
|
|
2445
|
-
* Properties to be passed to the label
|
|
2565
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
2566
|
+
* @example
|
|
2567
|
+
* ```tsx
|
|
2568
|
+
* setChoiceMenuOptions([
|
|
2569
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
2570
|
+
* ])
|
|
2571
|
+
* return <List>
|
|
2572
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
2573
|
+
* return (
|
|
2574
|
+
* <ChoiceButton
|
|
2575
|
+
* disabled={item.props.disabled}
|
|
2576
|
+
* onClick={() => {
|
|
2577
|
+
* afterSelectChoice(item)
|
|
2578
|
+
* }}
|
|
2579
|
+
* >
|
|
2580
|
+
* {item.text}
|
|
2581
|
+
* </ChoiceButton>
|
|
2582
|
+
* )
|
|
2583
|
+
* })}
|
|
2584
|
+
* </List>
|
|
2585
|
+
* ```
|
|
2446
2586
|
*/
|
|
2447
2587
|
this.props = {};
|
|
2448
2588
|
this.text = text;
|
|
@@ -2549,21 +2689,18 @@ function getChoiceMenuOptions() {
|
|
|
2549
2689
|
d.forEach((option, index) => {
|
|
2550
2690
|
if (option.type === Close) {
|
|
2551
2691
|
let itemLabel = newCloseLabel(index);
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
type: Close,
|
|
2556
|
-
closeCurrentLabel: option.closeCurrentLabel,
|
|
2557
|
-
props: {}
|
|
2558
|
-
});
|
|
2692
|
+
let choice = new ChoiceMenuOptionClose(option.text, option.closeCurrentLabel);
|
|
2693
|
+
choice.label = itemLabel;
|
|
2694
|
+
options.push(choice);
|
|
2559
2695
|
return;
|
|
2560
2696
|
}
|
|
2561
2697
|
let label = getLabelById(option.label);
|
|
2562
2698
|
if (label) {
|
|
2563
|
-
let itemLabel = new Label(label.id, label.steps,
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
})
|
|
2699
|
+
let itemLabel = new Label(label.id, label.steps, {
|
|
2700
|
+
onStepStart: label.onStepStart,
|
|
2701
|
+
choiseIndex: index
|
|
2702
|
+
});
|
|
2703
|
+
options.push(new ChoiceMenuOption(option.text, itemLabel, option.props, option.type));
|
|
2567
2704
|
}
|
|
2568
2705
|
});
|
|
2569
2706
|
return options;
|