@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
|
@@ -64,19 +64,18 @@ function checkIfStepsIsEqual(step1, step2) {
|
|
|
64
64
|
return step1 === step2;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
// src/classes/
|
|
68
|
-
var
|
|
67
|
+
// src/classes/LabelAbstract.ts
|
|
68
|
+
var LabelAbstract = class {
|
|
69
69
|
/**
|
|
70
70
|
* @param id is the id of the label
|
|
71
|
-
* @param
|
|
72
|
-
* @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
|
|
73
|
-
* @param choiseIndex is the index of the choice that the label will perform
|
|
71
|
+
* @param props is the properties of the label
|
|
74
72
|
*/
|
|
75
|
-
constructor(id,
|
|
73
|
+
constructor(id, props) {
|
|
76
74
|
this._id = id;
|
|
77
|
-
this.
|
|
78
|
-
this.
|
|
79
|
-
this.
|
|
75
|
+
this._onStepStart = props == null ? void 0 : props.onStepStart;
|
|
76
|
+
this._onLoadStep = props == null ? void 0 : props.onLoadStep;
|
|
77
|
+
this._onStepEnd = props == null ? void 0 : props.onStepEnd;
|
|
78
|
+
this._choiseIndex = props == null ? void 0 : props.choiseIndex;
|
|
80
79
|
}
|
|
81
80
|
/**
|
|
82
81
|
* Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
|
|
@@ -84,17 +83,6 @@ var Label = class {
|
|
|
84
83
|
get id() {
|
|
85
84
|
return this._id;
|
|
86
85
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Get the steps of the label.
|
|
89
|
-
* This class should be extended and the steps method should be overridden.
|
|
90
|
-
* Every time you update this list will also be updated when the other game versions load.
|
|
91
|
-
*/
|
|
92
|
-
get steps() {
|
|
93
|
-
if (typeof this._steps === "function") {
|
|
94
|
-
return this._steps();
|
|
95
|
-
}
|
|
96
|
-
return this._steps;
|
|
97
|
-
}
|
|
98
86
|
/**
|
|
99
87
|
* Get the corresponding steps number
|
|
100
88
|
* @param externalSteps
|
|
@@ -113,28 +101,66 @@ var Label = class {
|
|
|
113
101
|
return res;
|
|
114
102
|
}
|
|
115
103
|
/**
|
|
116
|
-
*
|
|
104
|
+
* 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.
|
|
117
105
|
* @returns Promise<void> or void
|
|
118
|
-
* @example
|
|
119
|
-
* ```typescript
|
|
120
|
-
* newLabel("id", [], () => {
|
|
121
|
-
* Assets.load('path/to/image1.png')
|
|
122
|
-
* Assets.load('path/to/image2.png')
|
|
123
|
-
* })
|
|
124
|
-
* ```
|
|
125
106
|
*/
|
|
126
|
-
get
|
|
127
|
-
return this
|
|
107
|
+
get onStepStart() {
|
|
108
|
+
return (stepIndex, label) => __async(this, null, function* () {
|
|
109
|
+
if (this._onLoadStep) {
|
|
110
|
+
yield this._onLoadStep(stepIndex, label);
|
|
111
|
+
}
|
|
112
|
+
if (this._onStepStart) {
|
|
113
|
+
return yield this._onStepStart(stepIndex, label);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* 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.
|
|
119
|
+
* @returns Promise<void> or void
|
|
120
|
+
*/
|
|
121
|
+
get onLoadStep() {
|
|
122
|
+
return this._onLoadStep;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Is a function that will be executed when the step ends.
|
|
126
|
+
* @returns Promise<void> or void
|
|
127
|
+
*/
|
|
128
|
+
get onStepEnd() {
|
|
129
|
+
return this._onStepEnd;
|
|
128
130
|
}
|
|
129
131
|
get choiseIndex() {
|
|
130
132
|
return this._choiseIndex;
|
|
131
133
|
}
|
|
132
134
|
};
|
|
133
135
|
|
|
136
|
+
// src/classes/Label.ts
|
|
137
|
+
var Label = class extends LabelAbstract {
|
|
138
|
+
/**
|
|
139
|
+
* @param id is the id of the label
|
|
140
|
+
* @param steps is the list of steps that the label will perform
|
|
141
|
+
* @param props is the properties of the label
|
|
142
|
+
*/
|
|
143
|
+
constructor(id, steps, props) {
|
|
144
|
+
super(id, props);
|
|
145
|
+
this._steps = steps;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Get the steps of the label.
|
|
149
|
+
*/
|
|
150
|
+
get steps() {
|
|
151
|
+
if (typeof this._steps === "function") {
|
|
152
|
+
return this._steps();
|
|
153
|
+
}
|
|
154
|
+
return this._steps;
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
134
158
|
// src/classes/CloseLabel.ts
|
|
135
159
|
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
136
160
|
function newCloseLabel(choiseIndex) {
|
|
137
|
-
return new Label(CLOSE_LABEL_ID, [],
|
|
161
|
+
return new Label(CLOSE_LABEL_ID, [], {
|
|
162
|
+
choiseIndex
|
|
163
|
+
});
|
|
138
164
|
}
|
|
139
165
|
|
|
140
166
|
// src/decorators/LabelDecorator.ts
|
|
@@ -594,8 +620,6 @@ function getMemoryContainer(element) {
|
|
|
594
620
|
};
|
|
595
621
|
}
|
|
596
622
|
function setMemoryContainer(element, memory) {
|
|
597
|
-
memory.width && (element.width = memory.width);
|
|
598
|
-
memory.height && (element.height = memory.height);
|
|
599
623
|
memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
|
|
600
624
|
memory.blendMode && (element.blendMode = memory.blendMode);
|
|
601
625
|
memory.tint && (element.tint = memory.tint);
|
|
@@ -628,6 +652,8 @@ function setMemoryContainer(element, memory) {
|
|
|
628
652
|
memory.interactive && (element.interactive = memory.interactive);
|
|
629
653
|
memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
|
|
630
654
|
memory.hitArea && (element.hitArea = memory.hitArea);
|
|
655
|
+
memory.width && (element.width = memory.width);
|
|
656
|
+
memory.height && (element.height = memory.height);
|
|
631
657
|
}
|
|
632
658
|
|
|
633
659
|
// src/decorators/TickerDecorator.ts
|
|
@@ -738,8 +764,9 @@ FadeAlphaTicker = __decorateClass([
|
|
|
738
764
|
], FadeAlphaTicker);
|
|
739
765
|
|
|
740
766
|
// src/functions/TickerUtility.ts
|
|
741
|
-
function updateTickerProgression(args, propertyName, progression) {
|
|
742
|
-
|
|
767
|
+
function updateTickerProgression(args, propertyName, progression, valueConvert) {
|
|
768
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
769
|
+
if (args[propertyName] === void 0 || !progression || args[propertyName] === limit) {
|
|
743
770
|
return;
|
|
744
771
|
}
|
|
745
772
|
if (typeof args[propertyName] === "number") {
|
|
@@ -758,22 +785,25 @@ function updateTickerProgression(args, propertyName, progression) {
|
|
|
758
785
|
}
|
|
759
786
|
}
|
|
760
787
|
}
|
|
761
|
-
function getLinearProgression(number, progression) {
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
return
|
|
788
|
+
function getLinearProgression(number, progression, valueConvert) {
|
|
789
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
790
|
+
let amt = valueConvert ? valueConvert(progression.amt) : progression.amt;
|
|
791
|
+
if (limit !== void 0) {
|
|
792
|
+
if (number > limit && amt > 0) {
|
|
793
|
+
return limit;
|
|
794
|
+
} else if (number < limit && amt < 0) {
|
|
795
|
+
return limit;
|
|
767
796
|
}
|
|
768
797
|
}
|
|
769
|
-
return number +
|
|
798
|
+
return number + amt;
|
|
770
799
|
}
|
|
771
|
-
function getExponentialProgression(number, progression) {
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
800
|
+
function getExponentialProgression(number, progression, valueConvert) {
|
|
801
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
802
|
+
if (limit !== void 0) {
|
|
803
|
+
if (number > limit && progression.percentage > 0) {
|
|
804
|
+
return limit;
|
|
805
|
+
} else if (number < limit && progression.percentage < 0) {
|
|
806
|
+
return limit;
|
|
777
807
|
}
|
|
778
808
|
}
|
|
779
809
|
return number + number * progression.percentage;
|
|
@@ -786,15 +816,13 @@ var MoveTicker = class extends TickerBase {
|
|
|
786
816
|
let ySpeed = 1;
|
|
787
817
|
if (args.speed) {
|
|
788
818
|
if (typeof args.speed === "number") {
|
|
789
|
-
xSpeed = args.speed;
|
|
790
|
-
ySpeed = args.speed;
|
|
819
|
+
xSpeed = this.speedConvert(args.speed);
|
|
820
|
+
ySpeed = this.speedConvert(args.speed);
|
|
791
821
|
} else {
|
|
792
|
-
xSpeed = args.speed.x;
|
|
793
|
-
ySpeed = args.speed.y;
|
|
822
|
+
xSpeed = this.speedConvert(args.speed.x);
|
|
823
|
+
ySpeed = this.speedConvert(args.speed.y);
|
|
794
824
|
}
|
|
795
825
|
}
|
|
796
|
-
xSpeed /= 60;
|
|
797
|
-
ySpeed /= 60;
|
|
798
826
|
let destination = args.destination;
|
|
799
827
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
800
828
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
@@ -834,7 +862,10 @@ var MoveTicker = class extends TickerBase {
|
|
|
834
862
|
}
|
|
835
863
|
});
|
|
836
864
|
if (args.speedProgression)
|
|
837
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
865
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
866
|
+
}
|
|
867
|
+
speedConvert(speed) {
|
|
868
|
+
return speed / 6;
|
|
838
869
|
}
|
|
839
870
|
};
|
|
840
871
|
MoveTicker = __decorateClass([
|
|
@@ -842,7 +873,7 @@ MoveTicker = __decorateClass([
|
|
|
842
873
|
], MoveTicker);
|
|
843
874
|
var RotateTicker = class extends TickerBase {
|
|
844
875
|
fn(ticker, args, tags, tickerId) {
|
|
845
|
-
let speed = (args.speed === void 0 ? 1 : args.speed)
|
|
876
|
+
let speed = this.speedConvert(args.speed === void 0 ? 1 : args.speed);
|
|
846
877
|
let clockwise = args.clockwise === void 0 ? true : args.clockwise;
|
|
847
878
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
848
879
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
@@ -870,7 +901,10 @@ var RotateTicker = class extends TickerBase {
|
|
|
870
901
|
}
|
|
871
902
|
});
|
|
872
903
|
if (args.speedProgression)
|
|
873
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
904
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
905
|
+
}
|
|
906
|
+
speedConvert(speed) {
|
|
907
|
+
return speed / 60;
|
|
874
908
|
}
|
|
875
909
|
};
|
|
876
910
|
RotateTicker = __decorateClass([
|
|
@@ -882,15 +916,13 @@ var ZoomTicker = class extends TickerBase {
|
|
|
882
916
|
let ySpeed = 0.1;
|
|
883
917
|
if (args.speed) {
|
|
884
918
|
if (typeof args.speed === "number") {
|
|
885
|
-
xSpeed = args.speed;
|
|
886
|
-
ySpeed = args.speed;
|
|
919
|
+
xSpeed = this.speedConvert(args.speed);
|
|
920
|
+
ySpeed = this.speedConvert(args.speed);
|
|
887
921
|
} else {
|
|
888
|
-
xSpeed = args.speed.x;
|
|
889
|
-
ySpeed = args.speed.y;
|
|
922
|
+
xSpeed = this.speedConvert(args.speed.x);
|
|
923
|
+
ySpeed = this.speedConvert(args.speed.y);
|
|
890
924
|
}
|
|
891
925
|
}
|
|
892
|
-
xSpeed /= 60;
|
|
893
|
-
ySpeed /= 60;
|
|
894
926
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
895
927
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
896
928
|
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
@@ -957,7 +989,10 @@ var ZoomTicker = class extends TickerBase {
|
|
|
957
989
|
}
|
|
958
990
|
});
|
|
959
991
|
if (args.speedProgression)
|
|
960
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
992
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
993
|
+
}
|
|
994
|
+
speedConvert(speed) {
|
|
995
|
+
return speed / 60;
|
|
961
996
|
}
|
|
962
997
|
onEndOfTicker(tag, tickerId, _element, tagToRemoveAfter2) {
|
|
963
998
|
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
@@ -1919,6 +1954,16 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1919
1954
|
static set originalStepData(value) {
|
|
1920
1955
|
_GameStepManager._originalStepData = createExportableElement(value);
|
|
1921
1956
|
}
|
|
1957
|
+
static get currentStepData() {
|
|
1958
|
+
let currentStepData = {
|
|
1959
|
+
path: window.location.pathname,
|
|
1960
|
+
storage: GameStorageManager.export(),
|
|
1961
|
+
canvas: GameWindowManager.export(),
|
|
1962
|
+
labelIndex: _GameStepManager.currentLabelStepIndex || 0,
|
|
1963
|
+
openedLabels: createExportableElement(_GameStepManager._openedLabels)
|
|
1964
|
+
};
|
|
1965
|
+
return currentStepData;
|
|
1966
|
+
}
|
|
1922
1967
|
/* Edit History Methods */
|
|
1923
1968
|
/**
|
|
1924
1969
|
* Add a label to the history.
|
|
@@ -1926,19 +1971,13 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1926
1971
|
*/
|
|
1927
1972
|
static addStepHistory(step, choiseMade) {
|
|
1928
1973
|
let stepHistory = getStepSha1(step);
|
|
1929
|
-
let
|
|
1930
|
-
path: window.location.pathname,
|
|
1931
|
-
storage: GameStorageManager.export(),
|
|
1932
|
-
canvas: GameWindowManager.export(),
|
|
1933
|
-
labelIndex: _GameStepManager.currentLabelStepIndex || 0,
|
|
1934
|
-
openedLabels: createExportableElement(_GameStepManager._openedLabels)
|
|
1935
|
-
};
|
|
1974
|
+
let currentStepData = _GameStepManager.currentStepData;
|
|
1936
1975
|
if (_GameStepManager.originalStepData) {
|
|
1937
|
-
if (_GameStepManager.originalStepData.openedLabels.length ===
|
|
1976
|
+
if (_GameStepManager.originalStepData.openedLabels.length === currentStepData.openedLabels.length) {
|
|
1938
1977
|
try {
|
|
1939
1978
|
let lastStepDataOpenedLabelsString = JSON.stringify(_GameStepManager.originalStepData.openedLabels);
|
|
1940
|
-
let historyStepOpenedLabelsString = JSON.stringify(
|
|
1941
|
-
if (lastStepDataOpenedLabelsString === historyStepOpenedLabelsString && _GameStepManager.originalStepData.path ===
|
|
1979
|
+
let historyStepOpenedLabelsString = JSON.stringify(currentStepData.openedLabels);
|
|
1980
|
+
if (lastStepDataOpenedLabelsString === historyStepOpenedLabelsString && _GameStepManager.originalStepData.path === currentStepData.path && _GameStepManager.originalStepData.labelIndex === currentStepData.labelIndex) {
|
|
1942
1981
|
return;
|
|
1943
1982
|
}
|
|
1944
1983
|
} catch (e) {
|
|
@@ -1946,7 +1985,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1946
1985
|
}
|
|
1947
1986
|
}
|
|
1948
1987
|
}
|
|
1949
|
-
let data = deepDiff.diff(_GameStepManager.originalStepData,
|
|
1988
|
+
let data = deepDiff.diff(_GameStepManager.originalStepData, currentStepData);
|
|
1950
1989
|
if (data) {
|
|
1951
1990
|
let dialoge = void 0;
|
|
1952
1991
|
let requiredChoices = void 0;
|
|
@@ -1965,7 +2004,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1965
2004
|
index: _GameStepManager.lastStepIndex,
|
|
1966
2005
|
choiceIndexMade: choiseMade
|
|
1967
2006
|
});
|
|
1968
|
-
_GameStepManager.originalStepData =
|
|
2007
|
+
_GameStepManager.originalStepData = currentStepData;
|
|
1969
2008
|
}
|
|
1970
2009
|
_GameStepManager.increaseLastStepIndex();
|
|
1971
2010
|
}
|
|
@@ -2056,6 +2095,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2056
2095
|
console.warn("[Pixi'VN] The player must make a choice");
|
|
2057
2096
|
return;
|
|
2058
2097
|
}
|
|
2098
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2099
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2100
|
+
}
|
|
2059
2101
|
_GameStepManager.increaseCurrentStepIndex();
|
|
2060
2102
|
return yield _GameStepManager.runCurrentStep(props, choiseMade);
|
|
2061
2103
|
});
|
|
@@ -2080,6 +2122,10 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2080
2122
|
return;
|
|
2081
2123
|
}
|
|
2082
2124
|
if (currentLabel.steps.length > currentLabelStepIndex) {
|
|
2125
|
+
let onStepRun = currentLabel.onStepStart;
|
|
2126
|
+
if (onStepRun) {
|
|
2127
|
+
yield onStepRun(currentLabelStepIndex, currentLabel);
|
|
2128
|
+
}
|
|
2083
2129
|
let step = currentLabel.steps[currentLabelStepIndex];
|
|
2084
2130
|
let result = yield step(props);
|
|
2085
2131
|
_GameStepManager.addStepHistory(step, choiseMade);
|
|
@@ -2144,6 +2190,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2144
2190
|
if (!tempLabel) {
|
|
2145
2191
|
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
2146
2192
|
}
|
|
2193
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2194
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2195
|
+
}
|
|
2147
2196
|
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
2148
2197
|
} catch (e) {
|
|
2149
2198
|
console.error("[Pixi'VN] Error calling label", e);
|
|
@@ -2202,6 +2251,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2202
2251
|
if (!tempLabel) {
|
|
2203
2252
|
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
2204
2253
|
}
|
|
2254
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2255
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2256
|
+
}
|
|
2205
2257
|
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
2206
2258
|
} catch (e) {
|
|
2207
2259
|
console.error("[Pixi'VN] Error jumping label", e);
|
|
@@ -2307,24 +2359,29 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2307
2359
|
* ```
|
|
2308
2360
|
*/
|
|
2309
2361
|
static goBack(navigate, steps = 1) {
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2362
|
+
return __async(this, null, function* () {
|
|
2363
|
+
if (steps <= 0) {
|
|
2364
|
+
console.warn("[Pixi'VN] Steps must be greater than 0");
|
|
2365
|
+
return;
|
|
2366
|
+
}
|
|
2367
|
+
if (_GameStepManager._stepsHistory.length <= 1) {
|
|
2368
|
+
console.warn("[Pixi'VN] No steps to go back");
|
|
2369
|
+
return;
|
|
2370
|
+
}
|
|
2371
|
+
let restoredStep = _GameStepManager.goBackInternal(steps, _GameStepManager.originalStepData);
|
|
2372
|
+
if (restoredStep) {
|
|
2373
|
+
_GameStepManager._originalStepData = restoredStep;
|
|
2374
|
+
_GameStepManager._openedLabels = createExportableElement(restoredStep.openedLabels);
|
|
2375
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onLoadStep) {
|
|
2376
|
+
yield _GameStepManager.currentLabel.onLoadStep(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2377
|
+
}
|
|
2378
|
+
GameStorageManager.import(createExportableElement(restoredStep.storage));
|
|
2379
|
+
GameWindowManager.import(createExportableElement(restoredStep.canvas));
|
|
2380
|
+
navigate(restoredStep.path);
|
|
2381
|
+
} else {
|
|
2382
|
+
console.error("[Pixi'VN] Error going back");
|
|
2383
|
+
}
|
|
2384
|
+
});
|
|
2328
2385
|
}
|
|
2329
2386
|
static goBackInternal(steps, restoredStep) {
|
|
2330
2387
|
if (steps <= 0) {
|
|
@@ -2386,38 +2443,45 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2386
2443
|
* @param dataString The history in a JSON string.
|
|
2387
2444
|
*/
|
|
2388
2445
|
static importJson(dataString) {
|
|
2389
|
-
|
|
2446
|
+
return __async(this, null, function* () {
|
|
2447
|
+
yield _GameStepManager.import(JSON.parse(dataString));
|
|
2448
|
+
});
|
|
2390
2449
|
}
|
|
2391
2450
|
/**
|
|
2392
2451
|
* Import the history from an object.
|
|
2393
2452
|
* @param data The history in an object.
|
|
2394
2453
|
*/
|
|
2395
2454
|
static import(data) {
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2455
|
+
return __async(this, null, function* () {
|
|
2456
|
+
_GameStepManager.clear();
|
|
2457
|
+
try {
|
|
2458
|
+
if (data.hasOwnProperty("stepsHistory")) {
|
|
2459
|
+
_GameStepManager._stepsHistory = data["stepsHistory"];
|
|
2460
|
+
} else {
|
|
2461
|
+
console.warn("[Pixi'VN] Could not import stepsHistory data, so will be ignored");
|
|
2462
|
+
}
|
|
2463
|
+
if (data.hasOwnProperty("openedLabels")) {
|
|
2464
|
+
_GameStepManager._openedLabels = data["openedLabels"];
|
|
2465
|
+
} else {
|
|
2466
|
+
console.warn("[Pixi'VN] Could not import openedLabels data, so will be ignored");
|
|
2467
|
+
}
|
|
2468
|
+
if (data.hasOwnProperty("lastStepIndex")) {
|
|
2469
|
+
_GameStepManager._lastStepIndex = data["lastStepIndex"];
|
|
2470
|
+
} else {
|
|
2471
|
+
console.warn("[Pixi'VN] Could not import lastStepIndex data, so will be ignored");
|
|
2472
|
+
}
|
|
2473
|
+
if (data.hasOwnProperty("originalStepData")) {
|
|
2474
|
+
_GameStepManager._originalStepData = data["originalStepData"];
|
|
2475
|
+
} else {
|
|
2476
|
+
console.warn("[Pixi'VN] Could not import originalStepData data, so will be ignored");
|
|
2477
|
+
}
|
|
2478
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onLoadStep) {
|
|
2479
|
+
yield _GameStepManager.currentLabel.onLoadStep(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2480
|
+
}
|
|
2481
|
+
} catch (e) {
|
|
2482
|
+
console.error("[Pixi'VN] Error importing data", e);
|
|
2417
2483
|
}
|
|
2418
|
-
}
|
|
2419
|
-
console.error("[Pixi'VN] Error importing data", e);
|
|
2420
|
-
}
|
|
2484
|
+
});
|
|
2421
2485
|
}
|
|
2422
2486
|
};
|
|
2423
2487
|
/**
|
|
@@ -2433,6 +2497,62 @@ var GameStepManager = _GameStepManager;
|
|
|
2433
2497
|
var Close = "close";
|
|
2434
2498
|
|
|
2435
2499
|
// src/classes/ChoiceMenuOption.ts
|
|
2500
|
+
var ChoiceMenuOption = class {
|
|
2501
|
+
/**
|
|
2502
|
+
* @param text Text to be displayed in the menu
|
|
2503
|
+
* @param label Label to be opened when the option is selected or the id of the label
|
|
2504
|
+
* @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.
|
|
2505
|
+
* @param type Type of the label to be opened. @default "call"
|
|
2506
|
+
*/
|
|
2507
|
+
constructor(text, label, props, type = "call") {
|
|
2508
|
+
/**
|
|
2509
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
2510
|
+
* @example
|
|
2511
|
+
* ```tsx
|
|
2512
|
+
* setChoiceMenuOptions([
|
|
2513
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
2514
|
+
* ])
|
|
2515
|
+
* return <List>
|
|
2516
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
2517
|
+
* return (
|
|
2518
|
+
* <ChoiceButton
|
|
2519
|
+
* disabled={item.props.disabled}
|
|
2520
|
+
* onClick={() => {
|
|
2521
|
+
* afterSelectChoice(item)
|
|
2522
|
+
* }}
|
|
2523
|
+
* >
|
|
2524
|
+
* {item.text}
|
|
2525
|
+
* </ChoiceButton>
|
|
2526
|
+
* )
|
|
2527
|
+
* })}
|
|
2528
|
+
* </List>
|
|
2529
|
+
* ```
|
|
2530
|
+
*/
|
|
2531
|
+
this.props = {};
|
|
2532
|
+
this.text = text;
|
|
2533
|
+
this._label = label;
|
|
2534
|
+
this.type = type;
|
|
2535
|
+
if (props) {
|
|
2536
|
+
this.props = props;
|
|
2537
|
+
}
|
|
2538
|
+
}
|
|
2539
|
+
/**
|
|
2540
|
+
* Label to be opened when the option is selected
|
|
2541
|
+
*/
|
|
2542
|
+
get label() {
|
|
2543
|
+
let label = this._label;
|
|
2544
|
+
if (typeof label === "string") {
|
|
2545
|
+
let res = getLabelById(label);
|
|
2546
|
+
if (res) {
|
|
2547
|
+
label = res;
|
|
2548
|
+
} else {
|
|
2549
|
+
console.error(`Label ${label} not found, so it will be closed`);
|
|
2550
|
+
label = newCloseLabel();
|
|
2551
|
+
}
|
|
2552
|
+
}
|
|
2553
|
+
return label;
|
|
2554
|
+
}
|
|
2555
|
+
};
|
|
2436
2556
|
var ChoiceMenuOptionClose = class {
|
|
2437
2557
|
/**
|
|
2438
2558
|
* @param text Text to be displayed in the menu
|
|
@@ -2448,7 +2568,27 @@ var ChoiceMenuOptionClose = class {
|
|
|
2448
2568
|
*/
|
|
2449
2569
|
this.type = Close;
|
|
2450
2570
|
/**
|
|
2451
|
-
* Properties to be passed to the label
|
|
2571
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
2572
|
+
* @example
|
|
2573
|
+
* ```tsx
|
|
2574
|
+
* setChoiceMenuOptions([
|
|
2575
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
2576
|
+
* ])
|
|
2577
|
+
* return <List>
|
|
2578
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
2579
|
+
* return (
|
|
2580
|
+
* <ChoiceButton
|
|
2581
|
+
* disabled={item.props.disabled}
|
|
2582
|
+
* onClick={() => {
|
|
2583
|
+
* afterSelectChoice(item)
|
|
2584
|
+
* }}
|
|
2585
|
+
* >
|
|
2586
|
+
* {item.text}
|
|
2587
|
+
* </ChoiceButton>
|
|
2588
|
+
* )
|
|
2589
|
+
* })}
|
|
2590
|
+
* </List>
|
|
2591
|
+
* ```
|
|
2452
2592
|
*/
|
|
2453
2593
|
this.props = {};
|
|
2454
2594
|
this.text = text;
|
|
@@ -2555,21 +2695,18 @@ function getChoiceMenuOptions() {
|
|
|
2555
2695
|
d.forEach((option, index) => {
|
|
2556
2696
|
if (option.type === Close) {
|
|
2557
2697
|
let itemLabel = newCloseLabel(index);
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
type: Close,
|
|
2562
|
-
closeCurrentLabel: option.closeCurrentLabel,
|
|
2563
|
-
props: {}
|
|
2564
|
-
});
|
|
2698
|
+
let choice = new ChoiceMenuOptionClose(option.text, option.closeCurrentLabel);
|
|
2699
|
+
choice.label = itemLabel;
|
|
2700
|
+
options.push(choice);
|
|
2565
2701
|
return;
|
|
2566
2702
|
}
|
|
2567
2703
|
let label = getLabelById(option.label);
|
|
2568
2704
|
if (label) {
|
|
2569
|
-
let itemLabel = new Label(label.id, label.steps,
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
})
|
|
2705
|
+
let itemLabel = new Label(label.id, label.steps, {
|
|
2706
|
+
onStepStart: label.onStepStart,
|
|
2707
|
+
choiseIndex: index
|
|
2708
|
+
});
|
|
2709
|
+
options.push(new ChoiceMenuOption(option.text, itemLabel, option.props, option.type));
|
|
2573
2710
|
}
|
|
2574
2711
|
});
|
|
2575
2712
|
return options;
|