@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
package/dist/labels/index.js
CHANGED
|
@@ -78,19 +78,18 @@ function checkIfStepsIsEqual(step1, step2) {
|
|
|
78
78
|
return step1 === step2;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
// src/classes/
|
|
82
|
-
var
|
|
81
|
+
// src/classes/LabelAbstract.ts
|
|
82
|
+
var LabelAbstract = class {
|
|
83
83
|
/**
|
|
84
84
|
* @param id is the id of the label
|
|
85
|
-
* @param
|
|
86
|
-
* @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
|
|
87
|
-
* @param choiseIndex is the index of the choice that the label will perform
|
|
85
|
+
* @param props is the properties of the label
|
|
88
86
|
*/
|
|
89
|
-
constructor(id,
|
|
87
|
+
constructor(id, props) {
|
|
90
88
|
this._id = id;
|
|
91
|
-
this.
|
|
92
|
-
this.
|
|
93
|
-
this.
|
|
89
|
+
this._onStepStart = props == null ? void 0 : props.onStepStart;
|
|
90
|
+
this._onLoadStep = props == null ? void 0 : props.onLoadStep;
|
|
91
|
+
this._onStepEnd = props == null ? void 0 : props.onStepEnd;
|
|
92
|
+
this._choiseIndex = props == null ? void 0 : props.choiseIndex;
|
|
94
93
|
}
|
|
95
94
|
/**
|
|
96
95
|
* Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
|
|
@@ -98,17 +97,6 @@ var Label = class {
|
|
|
98
97
|
get id() {
|
|
99
98
|
return this._id;
|
|
100
99
|
}
|
|
101
|
-
/**
|
|
102
|
-
* Get the steps of the label.
|
|
103
|
-
* This class should be extended and the steps method should be overridden.
|
|
104
|
-
* Every time you update this list will also be updated when the other game versions load.
|
|
105
|
-
*/
|
|
106
|
-
get steps() {
|
|
107
|
-
if (typeof this._steps === "function") {
|
|
108
|
-
return this._steps();
|
|
109
|
-
}
|
|
110
|
-
return this._steps;
|
|
111
|
-
}
|
|
112
100
|
/**
|
|
113
101
|
* Get the corresponding steps number
|
|
114
102
|
* @param externalSteps
|
|
@@ -127,37 +115,75 @@ var Label = class {
|
|
|
127
115
|
return res;
|
|
128
116
|
}
|
|
129
117
|
/**
|
|
130
|
-
*
|
|
118
|
+
* 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.
|
|
131
119
|
* @returns Promise<void> or void
|
|
132
|
-
* @example
|
|
133
|
-
* ```typescript
|
|
134
|
-
* newLabel("id", [], () => {
|
|
135
|
-
* Assets.load('path/to/image1.png')
|
|
136
|
-
* Assets.load('path/to/image2.png')
|
|
137
|
-
* })
|
|
138
|
-
* ```
|
|
139
120
|
*/
|
|
140
|
-
get
|
|
141
|
-
return this
|
|
121
|
+
get onStepStart() {
|
|
122
|
+
return (stepIndex, label) => __async(this, null, function* () {
|
|
123
|
+
if (this._onLoadStep) {
|
|
124
|
+
yield this._onLoadStep(stepIndex, label);
|
|
125
|
+
}
|
|
126
|
+
if (this._onStepStart) {
|
|
127
|
+
return yield this._onStepStart(stepIndex, label);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* 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.
|
|
133
|
+
* @returns Promise<void> or void
|
|
134
|
+
*/
|
|
135
|
+
get onLoadStep() {
|
|
136
|
+
return this._onLoadStep;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Is a function that will be executed when the step ends.
|
|
140
|
+
* @returns Promise<void> or void
|
|
141
|
+
*/
|
|
142
|
+
get onStepEnd() {
|
|
143
|
+
return this._onStepEnd;
|
|
142
144
|
}
|
|
143
145
|
get choiseIndex() {
|
|
144
146
|
return this._choiseIndex;
|
|
145
147
|
}
|
|
146
148
|
};
|
|
147
149
|
|
|
150
|
+
// src/classes/Label.ts
|
|
151
|
+
var Label = class extends LabelAbstract {
|
|
152
|
+
/**
|
|
153
|
+
* @param id is the id of the label
|
|
154
|
+
* @param steps is the list of steps that the label will perform
|
|
155
|
+
* @param props is the properties of the label
|
|
156
|
+
*/
|
|
157
|
+
constructor(id, steps, props) {
|
|
158
|
+
super(id, props);
|
|
159
|
+
this._steps = steps;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Get the steps of the label.
|
|
163
|
+
*/
|
|
164
|
+
get steps() {
|
|
165
|
+
if (typeof this._steps === "function") {
|
|
166
|
+
return this._steps();
|
|
167
|
+
}
|
|
168
|
+
return this._steps;
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
|
|
148
172
|
// src/classes/CloseLabel.ts
|
|
149
173
|
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
150
174
|
function newCloseLabel(choiseIndex) {
|
|
151
|
-
return new Label(CLOSE_LABEL_ID, [],
|
|
175
|
+
return new Label(CLOSE_LABEL_ID, [], {
|
|
176
|
+
choiseIndex
|
|
177
|
+
});
|
|
152
178
|
}
|
|
153
179
|
|
|
154
180
|
// src/decorators/LabelDecorator.ts
|
|
155
181
|
var registeredLabels = {};
|
|
156
|
-
function newLabel(id, steps,
|
|
182
|
+
function newLabel(id, steps, props) {
|
|
157
183
|
if (registeredLabels[id]) {
|
|
158
184
|
console.info(`[Pixi'VN] Label ${id} already exists, it will be overwritten`);
|
|
159
185
|
}
|
|
160
|
-
let label = new Label(id, steps,
|
|
186
|
+
let label = new Label(id, steps, props);
|
|
161
187
|
registeredLabels[id] = label;
|
|
162
188
|
return label;
|
|
163
189
|
}
|
|
@@ -246,8 +272,6 @@ function getMemoryContainer(element) {
|
|
|
246
272
|
};
|
|
247
273
|
}
|
|
248
274
|
function setMemoryContainer(element, memory) {
|
|
249
|
-
memory.width && (element.width = memory.width);
|
|
250
|
-
memory.height && (element.height = memory.height);
|
|
251
275
|
memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
|
|
252
276
|
memory.blendMode && (element.blendMode = memory.blendMode);
|
|
253
277
|
memory.tint && (element.tint = memory.tint);
|
|
@@ -280,6 +304,8 @@ function setMemoryContainer(element, memory) {
|
|
|
280
304
|
memory.interactive && (element.interactive = memory.interactive);
|
|
281
305
|
memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
|
|
282
306
|
memory.hitArea && (element.hitArea = memory.hitArea);
|
|
307
|
+
memory.width && (element.width = memory.width);
|
|
308
|
+
memory.height && (element.height = memory.height);
|
|
283
309
|
}
|
|
284
310
|
function getTexture(imageUrl) {
|
|
285
311
|
return __async(this, null, function* () {
|
|
@@ -722,29 +748,57 @@ var ChoiceMenuOption = class {
|
|
|
722
748
|
/**
|
|
723
749
|
* @param text Text to be displayed in the menu
|
|
724
750
|
* @param label Label to be opened when the option is selected or the id of the label
|
|
751
|
+
* @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.
|
|
725
752
|
* @param type Type of the label to be opened. @default "call"
|
|
726
|
-
* @param props Properties to be passed to the label, when the label is called. it cannot contain functions or classes. @default {}
|
|
727
753
|
*/
|
|
728
|
-
constructor(text, label, type = "call"
|
|
754
|
+
constructor(text, label, props, type = "call") {
|
|
729
755
|
/**
|
|
730
|
-
* Properties to be passed to the label
|
|
756
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
757
|
+
* @example
|
|
758
|
+
* ```tsx
|
|
759
|
+
* setChoiceMenuOptions([
|
|
760
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
761
|
+
* ])
|
|
762
|
+
* return <List>
|
|
763
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
764
|
+
* return (
|
|
765
|
+
* <ChoiceButton
|
|
766
|
+
* disabled={item.props.disabled}
|
|
767
|
+
* onClick={() => {
|
|
768
|
+
* afterSelectChoice(item)
|
|
769
|
+
* }}
|
|
770
|
+
* >
|
|
771
|
+
* {item.text}
|
|
772
|
+
* </ChoiceButton>
|
|
773
|
+
* )
|
|
774
|
+
* })}
|
|
775
|
+
* </List>
|
|
776
|
+
* ```
|
|
731
777
|
*/
|
|
732
778
|
this.props = {};
|
|
733
|
-
if (typeof label === "string") {
|
|
734
|
-
let tLabel = getLabelById(label);
|
|
735
|
-
if (!tLabel) {
|
|
736
|
-
throw new Error(`[Pixi'VN] Label ${label} not found`);
|
|
737
|
-
} else {
|
|
738
|
-
label = tLabel;
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
779
|
this.text = text;
|
|
742
|
-
this.
|
|
780
|
+
this._label = label;
|
|
743
781
|
this.type = type;
|
|
744
782
|
if (props) {
|
|
745
783
|
this.props = props;
|
|
746
784
|
}
|
|
747
785
|
}
|
|
786
|
+
/**
|
|
787
|
+
* Label to be opened when the option is selected
|
|
788
|
+
*/
|
|
789
|
+
get label() {
|
|
790
|
+
let label = this._label;
|
|
791
|
+
if (typeof label === "string") {
|
|
792
|
+
let res = getLabelById(label);
|
|
793
|
+
if (res) {
|
|
794
|
+
label = res;
|
|
795
|
+
} else {
|
|
796
|
+
console.error(`Label ${label} not found, so it will be closed`);
|
|
797
|
+
label = newCloseLabel();
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
return label;
|
|
801
|
+
}
|
|
748
802
|
};
|
|
749
803
|
var ChoiceMenuOptionClose = class {
|
|
750
804
|
/**
|
|
@@ -761,7 +815,27 @@ var ChoiceMenuOptionClose = class {
|
|
|
761
815
|
*/
|
|
762
816
|
this.type = Close;
|
|
763
817
|
/**
|
|
764
|
-
* Properties to be passed to the label
|
|
818
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
819
|
+
* @example
|
|
820
|
+
* ```tsx
|
|
821
|
+
* setChoiceMenuOptions([
|
|
822
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
823
|
+
* ])
|
|
824
|
+
* return <List>
|
|
825
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
826
|
+
* return (
|
|
827
|
+
* <ChoiceButton
|
|
828
|
+
* disabled={item.props.disabled}
|
|
829
|
+
* onClick={() => {
|
|
830
|
+
* afterSelectChoice(item)
|
|
831
|
+
* }}
|
|
832
|
+
* >
|
|
833
|
+
* {item.text}
|
|
834
|
+
* </ChoiceButton>
|
|
835
|
+
* )
|
|
836
|
+
* })}
|
|
837
|
+
* </List>
|
|
838
|
+
* ```
|
|
765
839
|
*/
|
|
766
840
|
this.props = {};
|
|
767
841
|
this.text = text;
|
|
@@ -819,21 +893,18 @@ function getChoiceMenuOptions() {
|
|
|
819
893
|
d.forEach((option, index) => {
|
|
820
894
|
if (option.type === Close) {
|
|
821
895
|
let itemLabel = newCloseLabel(index);
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
type: Close,
|
|
826
|
-
closeCurrentLabel: option.closeCurrentLabel,
|
|
827
|
-
props: {}
|
|
828
|
-
});
|
|
896
|
+
let choice = new ChoiceMenuOptionClose(option.text, option.closeCurrentLabel);
|
|
897
|
+
choice.label = itemLabel;
|
|
898
|
+
options.push(choice);
|
|
829
899
|
return;
|
|
830
900
|
}
|
|
831
901
|
let label = getLabelById(option.label);
|
|
832
902
|
if (label) {
|
|
833
|
-
let itemLabel = new Label(label.id, label.steps,
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
})
|
|
903
|
+
let itemLabel = new Label(label.id, label.steps, {
|
|
904
|
+
onStepStart: label.onStepStart,
|
|
905
|
+
choiseIndex: index
|
|
906
|
+
});
|
|
907
|
+
options.push(new ChoiceMenuOption(option.text, itemLabel, option.props, option.type));
|
|
837
908
|
}
|
|
838
909
|
});
|
|
839
910
|
return options;
|
|
@@ -921,8 +992,9 @@ FadeAlphaTicker = __decorateClass([
|
|
|
921
992
|
], FadeAlphaTicker);
|
|
922
993
|
|
|
923
994
|
// src/functions/TickerUtility.ts
|
|
924
|
-
function updateTickerProgression(args, propertyName, progression) {
|
|
925
|
-
|
|
995
|
+
function updateTickerProgression(args, propertyName, progression, valueConvert) {
|
|
996
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
997
|
+
if (args[propertyName] === void 0 || !progression || args[propertyName] === limit) {
|
|
926
998
|
return;
|
|
927
999
|
}
|
|
928
1000
|
if (typeof args[propertyName] === "number") {
|
|
@@ -941,22 +1013,25 @@ function updateTickerProgression(args, propertyName, progression) {
|
|
|
941
1013
|
}
|
|
942
1014
|
}
|
|
943
1015
|
}
|
|
944
|
-
function getLinearProgression(number, progression) {
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
return
|
|
1016
|
+
function getLinearProgression(number, progression, valueConvert) {
|
|
1017
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
1018
|
+
let amt = valueConvert ? valueConvert(progression.amt) : progression.amt;
|
|
1019
|
+
if (limit !== void 0) {
|
|
1020
|
+
if (number > limit && amt > 0) {
|
|
1021
|
+
return limit;
|
|
1022
|
+
} else if (number < limit && amt < 0) {
|
|
1023
|
+
return limit;
|
|
950
1024
|
}
|
|
951
1025
|
}
|
|
952
|
-
return number +
|
|
1026
|
+
return number + amt;
|
|
953
1027
|
}
|
|
954
|
-
function getExponentialProgression(number, progression) {
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
1028
|
+
function getExponentialProgression(number, progression, valueConvert) {
|
|
1029
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
1030
|
+
if (limit !== void 0) {
|
|
1031
|
+
if (number > limit && progression.percentage > 0) {
|
|
1032
|
+
return limit;
|
|
1033
|
+
} else if (number < limit && progression.percentage < 0) {
|
|
1034
|
+
return limit;
|
|
960
1035
|
}
|
|
961
1036
|
}
|
|
962
1037
|
return number + number * progression.percentage;
|
|
@@ -969,15 +1044,13 @@ var MoveTicker = class extends TickerBase {
|
|
|
969
1044
|
let ySpeed = 1;
|
|
970
1045
|
if (args.speed) {
|
|
971
1046
|
if (typeof args.speed === "number") {
|
|
972
|
-
xSpeed = args.speed;
|
|
973
|
-
ySpeed = args.speed;
|
|
1047
|
+
xSpeed = this.speedConvert(args.speed);
|
|
1048
|
+
ySpeed = this.speedConvert(args.speed);
|
|
974
1049
|
} else {
|
|
975
|
-
xSpeed = args.speed.x;
|
|
976
|
-
ySpeed = args.speed.y;
|
|
1050
|
+
xSpeed = this.speedConvert(args.speed.x);
|
|
1051
|
+
ySpeed = this.speedConvert(args.speed.y);
|
|
977
1052
|
}
|
|
978
1053
|
}
|
|
979
|
-
xSpeed /= 60;
|
|
980
|
-
ySpeed /= 60;
|
|
981
1054
|
let destination = args.destination;
|
|
982
1055
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
983
1056
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
@@ -1017,7 +1090,10 @@ var MoveTicker = class extends TickerBase {
|
|
|
1017
1090
|
}
|
|
1018
1091
|
});
|
|
1019
1092
|
if (args.speedProgression)
|
|
1020
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
1093
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
1094
|
+
}
|
|
1095
|
+
speedConvert(speed) {
|
|
1096
|
+
return speed / 6;
|
|
1021
1097
|
}
|
|
1022
1098
|
};
|
|
1023
1099
|
MoveTicker = __decorateClass([
|
|
@@ -1025,7 +1101,7 @@ MoveTicker = __decorateClass([
|
|
|
1025
1101
|
], MoveTicker);
|
|
1026
1102
|
var RotateTicker = class extends TickerBase {
|
|
1027
1103
|
fn(ticker, args, tags, tickerId) {
|
|
1028
|
-
let speed = (args.speed === void 0 ? 1 : args.speed)
|
|
1104
|
+
let speed = this.speedConvert(args.speed === void 0 ? 1 : args.speed);
|
|
1029
1105
|
let clockwise = args.clockwise === void 0 ? true : args.clockwise;
|
|
1030
1106
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
1031
1107
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
@@ -1053,7 +1129,10 @@ var RotateTicker = class extends TickerBase {
|
|
|
1053
1129
|
}
|
|
1054
1130
|
});
|
|
1055
1131
|
if (args.speedProgression)
|
|
1056
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
1132
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
1133
|
+
}
|
|
1134
|
+
speedConvert(speed) {
|
|
1135
|
+
return speed / 60;
|
|
1057
1136
|
}
|
|
1058
1137
|
};
|
|
1059
1138
|
RotateTicker = __decorateClass([
|
|
@@ -1065,15 +1144,13 @@ var ZoomTicker = class extends TickerBase {
|
|
|
1065
1144
|
let ySpeed = 0.1;
|
|
1066
1145
|
if (args.speed) {
|
|
1067
1146
|
if (typeof args.speed === "number") {
|
|
1068
|
-
xSpeed = args.speed;
|
|
1069
|
-
ySpeed = args.speed;
|
|
1147
|
+
xSpeed = this.speedConvert(args.speed);
|
|
1148
|
+
ySpeed = this.speedConvert(args.speed);
|
|
1070
1149
|
} else {
|
|
1071
|
-
xSpeed = args.speed.x;
|
|
1072
|
-
ySpeed = args.speed.y;
|
|
1150
|
+
xSpeed = this.speedConvert(args.speed.x);
|
|
1151
|
+
ySpeed = this.speedConvert(args.speed.y);
|
|
1073
1152
|
}
|
|
1074
1153
|
}
|
|
1075
|
-
xSpeed /= 60;
|
|
1076
|
-
ySpeed /= 60;
|
|
1077
1154
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
1078
1155
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
1079
1156
|
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
@@ -1140,7 +1217,10 @@ var ZoomTicker = class extends TickerBase {
|
|
|
1140
1217
|
}
|
|
1141
1218
|
});
|
|
1142
1219
|
if (args.speedProgression)
|
|
1143
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
1220
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
1221
|
+
}
|
|
1222
|
+
speedConvert(speed) {
|
|
1223
|
+
return speed / 60;
|
|
1144
1224
|
}
|
|
1145
1225
|
onEndOfTicker(tag, tickerId, _element, tagToRemoveAfter2) {
|
|
1146
1226
|
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
@@ -1163,6 +1243,7 @@ var ZoomInOutTicker = class extends ZoomTicker {
|
|
|
1163
1243
|
};
|
|
1164
1244
|
|
|
1165
1245
|
// src/constants.ts
|
|
1246
|
+
var PIXIVN_VERSION = "0.6.6";
|
|
1166
1247
|
var Repeat = "repeat";
|
|
1167
1248
|
function Pause(duration) {
|
|
1168
1249
|
return {
|
|
@@ -1340,14 +1421,14 @@ function zoomIn(_0, _1) {
|
|
|
1340
1421
|
} else {
|
|
1341
1422
|
canvasElement = image;
|
|
1342
1423
|
}
|
|
1343
|
-
if (canvasElement instanceof CanvasImage && ((_a = canvasElement.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
1344
|
-
yield canvasElement.load();
|
|
1345
|
-
}
|
|
1346
1424
|
let container = new CanvasContainer();
|
|
1347
1425
|
container.addChild(canvasElement);
|
|
1348
1426
|
container.height = GameWindowManager.canvasHeight;
|
|
1349
1427
|
container.width = GameWindowManager.canvasWidth;
|
|
1350
1428
|
GameWindowManager.addCanvasElement(tag, container);
|
|
1429
|
+
if (canvasElement instanceof CanvasImage && ((_a = canvasElement.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
1430
|
+
yield canvasElement.load();
|
|
1431
|
+
}
|
|
1351
1432
|
if (props.direction == "up") {
|
|
1352
1433
|
container.pivot.y = GameWindowManager.canvasHeight;
|
|
1353
1434
|
container.pivot.x = GameWindowManager.canvasWidth / 2;
|
|
@@ -2369,6 +2450,16 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2369
2450
|
static set originalStepData(value) {
|
|
2370
2451
|
_GameStepManager._originalStepData = createExportableElement(value);
|
|
2371
2452
|
}
|
|
2453
|
+
static get currentStepData() {
|
|
2454
|
+
let currentStepData = {
|
|
2455
|
+
path: window.location.pathname,
|
|
2456
|
+
storage: GameStorageManager.export(),
|
|
2457
|
+
canvas: GameWindowManager.export(),
|
|
2458
|
+
labelIndex: _GameStepManager.currentLabelStepIndex || 0,
|
|
2459
|
+
openedLabels: createExportableElement(_GameStepManager._openedLabels)
|
|
2460
|
+
};
|
|
2461
|
+
return currentStepData;
|
|
2462
|
+
}
|
|
2372
2463
|
/* Edit History Methods */
|
|
2373
2464
|
/**
|
|
2374
2465
|
* Add a label to the history.
|
|
@@ -2376,19 +2467,13 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2376
2467
|
*/
|
|
2377
2468
|
static addStepHistory(step, choiseMade) {
|
|
2378
2469
|
let stepHistory = getStepSha1(step);
|
|
2379
|
-
let
|
|
2380
|
-
path: window.location.pathname,
|
|
2381
|
-
storage: GameStorageManager.export(),
|
|
2382
|
-
canvas: GameWindowManager.export(),
|
|
2383
|
-
labelIndex: _GameStepManager.currentLabelStepIndex || 0,
|
|
2384
|
-
openedLabels: createExportableElement(_GameStepManager._openedLabels)
|
|
2385
|
-
};
|
|
2470
|
+
let currentStepData = _GameStepManager.currentStepData;
|
|
2386
2471
|
if (_GameStepManager.originalStepData) {
|
|
2387
|
-
if (_GameStepManager.originalStepData.openedLabels.length ===
|
|
2472
|
+
if (_GameStepManager.originalStepData.openedLabels.length === currentStepData.openedLabels.length) {
|
|
2388
2473
|
try {
|
|
2389
2474
|
let lastStepDataOpenedLabelsString = JSON.stringify(_GameStepManager.originalStepData.openedLabels);
|
|
2390
|
-
let historyStepOpenedLabelsString = JSON.stringify(
|
|
2391
|
-
if (lastStepDataOpenedLabelsString === historyStepOpenedLabelsString && _GameStepManager.originalStepData.path ===
|
|
2475
|
+
let historyStepOpenedLabelsString = JSON.stringify(currentStepData.openedLabels);
|
|
2476
|
+
if (lastStepDataOpenedLabelsString === historyStepOpenedLabelsString && _GameStepManager.originalStepData.path === currentStepData.path && _GameStepManager.originalStepData.labelIndex === currentStepData.labelIndex) {
|
|
2392
2477
|
return;
|
|
2393
2478
|
}
|
|
2394
2479
|
} catch (e) {
|
|
@@ -2396,7 +2481,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2396
2481
|
}
|
|
2397
2482
|
}
|
|
2398
2483
|
}
|
|
2399
|
-
let data = deepDiff.diff(_GameStepManager.originalStepData,
|
|
2484
|
+
let data = deepDiff.diff(_GameStepManager.originalStepData, currentStepData);
|
|
2400
2485
|
if (data) {
|
|
2401
2486
|
let dialoge = void 0;
|
|
2402
2487
|
let requiredChoices = void 0;
|
|
@@ -2415,7 +2500,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2415
2500
|
index: _GameStepManager.lastStepIndex,
|
|
2416
2501
|
choiceIndexMade: choiseMade
|
|
2417
2502
|
});
|
|
2418
|
-
_GameStepManager.originalStepData =
|
|
2503
|
+
_GameStepManager.originalStepData = currentStepData;
|
|
2419
2504
|
}
|
|
2420
2505
|
_GameStepManager.increaseLastStepIndex();
|
|
2421
2506
|
}
|
|
@@ -2506,6 +2591,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2506
2591
|
console.warn("[Pixi'VN] The player must make a choice");
|
|
2507
2592
|
return;
|
|
2508
2593
|
}
|
|
2594
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2595
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2596
|
+
}
|
|
2509
2597
|
_GameStepManager.increaseCurrentStepIndex();
|
|
2510
2598
|
return yield _GameStepManager.runCurrentStep(props, choiseMade);
|
|
2511
2599
|
});
|
|
@@ -2530,6 +2618,10 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2530
2618
|
return;
|
|
2531
2619
|
}
|
|
2532
2620
|
if (currentLabel.steps.length > currentLabelStepIndex) {
|
|
2621
|
+
let onStepRun = currentLabel.onStepStart;
|
|
2622
|
+
if (onStepRun) {
|
|
2623
|
+
yield onStepRun(currentLabelStepIndex, currentLabel);
|
|
2624
|
+
}
|
|
2533
2625
|
let step = currentLabel.steps[currentLabelStepIndex];
|
|
2534
2626
|
let result = yield step(props);
|
|
2535
2627
|
_GameStepManager.addStepHistory(step, choiseMade);
|
|
@@ -2594,6 +2686,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2594
2686
|
if (!tempLabel) {
|
|
2595
2687
|
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
2596
2688
|
}
|
|
2689
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2690
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2691
|
+
}
|
|
2597
2692
|
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
2598
2693
|
} catch (e) {
|
|
2599
2694
|
console.error("[Pixi'VN] Error calling label", e);
|
|
@@ -2652,6 +2747,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2652
2747
|
if (!tempLabel) {
|
|
2653
2748
|
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
2654
2749
|
}
|
|
2750
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2751
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2752
|
+
}
|
|
2655
2753
|
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
2656
2754
|
} catch (e) {
|
|
2657
2755
|
console.error("[Pixi'VN] Error jumping label", e);
|
|
@@ -2757,24 +2855,29 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2757
2855
|
* ```
|
|
2758
2856
|
*/
|
|
2759
2857
|
static goBack(navigate, steps = 1) {
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2858
|
+
return __async(this, null, function* () {
|
|
2859
|
+
if (steps <= 0) {
|
|
2860
|
+
console.warn("[Pixi'VN] Steps must be greater than 0");
|
|
2861
|
+
return;
|
|
2862
|
+
}
|
|
2863
|
+
if (_GameStepManager._stepsHistory.length <= 1) {
|
|
2864
|
+
console.warn("[Pixi'VN] No steps to go back");
|
|
2865
|
+
return;
|
|
2866
|
+
}
|
|
2867
|
+
let restoredStep = _GameStepManager.goBackInternal(steps, _GameStepManager.originalStepData);
|
|
2868
|
+
if (restoredStep) {
|
|
2869
|
+
_GameStepManager._originalStepData = restoredStep;
|
|
2870
|
+
_GameStepManager._openedLabels = createExportableElement(restoredStep.openedLabels);
|
|
2871
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onLoadStep) {
|
|
2872
|
+
yield _GameStepManager.currentLabel.onLoadStep(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2873
|
+
}
|
|
2874
|
+
GameStorageManager.import(createExportableElement(restoredStep.storage));
|
|
2875
|
+
GameWindowManager.import(createExportableElement(restoredStep.canvas));
|
|
2876
|
+
navigate(restoredStep.path);
|
|
2877
|
+
} else {
|
|
2878
|
+
console.error("[Pixi'VN] Error going back");
|
|
2879
|
+
}
|
|
2880
|
+
});
|
|
2778
2881
|
}
|
|
2779
2882
|
static goBackInternal(steps, restoredStep) {
|
|
2780
2883
|
if (steps <= 0) {
|
|
@@ -2836,38 +2939,45 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2836
2939
|
* @param dataString The history in a JSON string.
|
|
2837
2940
|
*/
|
|
2838
2941
|
static importJson(dataString) {
|
|
2839
|
-
|
|
2942
|
+
return __async(this, null, function* () {
|
|
2943
|
+
yield _GameStepManager.import(JSON.parse(dataString));
|
|
2944
|
+
});
|
|
2840
2945
|
}
|
|
2841
2946
|
/**
|
|
2842
2947
|
* Import the history from an object.
|
|
2843
2948
|
* @param data The history in an object.
|
|
2844
2949
|
*/
|
|
2845
2950
|
static import(data) {
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2951
|
+
return __async(this, null, function* () {
|
|
2952
|
+
_GameStepManager.clear();
|
|
2953
|
+
try {
|
|
2954
|
+
if (data.hasOwnProperty("stepsHistory")) {
|
|
2955
|
+
_GameStepManager._stepsHistory = data["stepsHistory"];
|
|
2956
|
+
} else {
|
|
2957
|
+
console.warn("[Pixi'VN] Could not import stepsHistory data, so will be ignored");
|
|
2958
|
+
}
|
|
2959
|
+
if (data.hasOwnProperty("openedLabels")) {
|
|
2960
|
+
_GameStepManager._openedLabels = data["openedLabels"];
|
|
2961
|
+
} else {
|
|
2962
|
+
console.warn("[Pixi'VN] Could not import openedLabels data, so will be ignored");
|
|
2963
|
+
}
|
|
2964
|
+
if (data.hasOwnProperty("lastStepIndex")) {
|
|
2965
|
+
_GameStepManager._lastStepIndex = data["lastStepIndex"];
|
|
2966
|
+
} else {
|
|
2967
|
+
console.warn("[Pixi'VN] Could not import lastStepIndex data, so will be ignored");
|
|
2968
|
+
}
|
|
2969
|
+
if (data.hasOwnProperty("originalStepData")) {
|
|
2970
|
+
_GameStepManager._originalStepData = data["originalStepData"];
|
|
2971
|
+
} else {
|
|
2972
|
+
console.warn("[Pixi'VN] Could not import originalStepData data, so will be ignored");
|
|
2973
|
+
}
|
|
2974
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onLoadStep) {
|
|
2975
|
+
yield _GameStepManager.currentLabel.onLoadStep(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2976
|
+
}
|
|
2977
|
+
} catch (e) {
|
|
2978
|
+
console.error("[Pixi'VN] Error importing data", e);
|
|
2867
2979
|
}
|
|
2868
|
-
}
|
|
2869
|
-
console.error("[Pixi'VN] Error importing data", e);
|
|
2870
|
-
}
|
|
2980
|
+
});
|
|
2871
2981
|
}
|
|
2872
2982
|
};
|
|
2873
2983
|
/**
|
|
@@ -3043,7 +3153,7 @@ var DialogueBaseModel = class {
|
|
|
3043
3153
|
var juliette = new CharacterBaseModel2("___pixivn_juliette___", {
|
|
3044
3154
|
name: "Juliette",
|
|
3045
3155
|
age: 25,
|
|
3046
|
-
icon: "https://firebasestorage.googleapis.com/v0/b/pixi-vn.appspot.com/o/public%2Fcharacters%2Fjuliette-square.webp?alt=media
|
|
3156
|
+
icon: "https://firebasestorage.googleapis.com/v0/b/pixi-vn.appspot.com/o/public%2Fcharacters%2Fjuliette-square.webp?alt=media",
|
|
3047
3157
|
color: "#ac0086"
|
|
3048
3158
|
});
|
|
3049
3159
|
saveCharacter(juliette);
|
|
@@ -3088,10 +3198,16 @@ var baseCanvasElementTestLabel = newLabel(
|
|
|
3088
3198
|
removeCanvasElement("container");
|
|
3089
3199
|
setDialogue({
|
|
3090
3200
|
character: juliette,
|
|
3091
|
-
text: `Here's what's going to happen: I'm going to create some
|
|
3201
|
+
text: `Here's what's going to happen: I'm going to create some CanvasText with different styles and put them on the stage.
|
|
3092
3202
|
But it will generate a warn message, because the FillGradient or FillPattern has not yet been supported by the Pixi\u2019VN ( you can see the status of the issue here: [#76](https://github.com/DRincs-Productions/pixi-vn/issues/76)).`
|
|
3093
3203
|
});
|
|
3094
|
-
const
|
|
3204
|
+
const basicStyle = new pixi_js.TextStyle({
|
|
3205
|
+
fill: "#ffffff"
|
|
3206
|
+
});
|
|
3207
|
+
const basicText = new CanvasText({
|
|
3208
|
+
text: "Basic text in pixi",
|
|
3209
|
+
style: basicStyle
|
|
3210
|
+
});
|
|
3095
3211
|
basicText.x = 50;
|
|
3096
3212
|
basicText.y = 100;
|
|
3097
3213
|
GameWindowManager.addCanvasElement("basicText", basicText);
|
|
@@ -3109,7 +3225,7 @@ But it will generate a warn message, because the FillGradient or FillPattern has
|
|
|
3109
3225
|
fill: { fill },
|
|
3110
3226
|
stroke: { color: "#4a1850", width: 5, join: "round" },
|
|
3111
3227
|
dropShadow: {
|
|
3112
|
-
color: "#
|
|
3228
|
+
color: "#ff5f74",
|
|
3113
3229
|
blur: 4,
|
|
3114
3230
|
angle: Math.PI / 6,
|
|
3115
3231
|
distance: 6
|
|
@@ -3162,36 +3278,30 @@ EventTest1 = __decorateClass([
|
|
|
3162
3278
|
eventDecorator("___pixi_vn_canvas_events_test_event1___")
|
|
3163
3279
|
], EventTest1);
|
|
3164
3280
|
var EventTest2 = class extends CanvasEvent {
|
|
3165
|
-
constructor() {
|
|
3166
|
-
super(...arguments);
|
|
3167
|
-
this.textureButtonDown = pixi_js.Texture.from("https://pixijs.com/assets/button_down.png");
|
|
3168
|
-
this.textureButtonOver = pixi_js.Texture.from("https://pixijs.com/assets/button_over.png");
|
|
3169
|
-
this.textureButton = pixi_js.Texture.from("https://pixijs.com/assets/button.png");
|
|
3170
|
-
}
|
|
3171
3281
|
fn(event, sprite) {
|
|
3172
3282
|
if (event === "pointerdown") {
|
|
3173
3283
|
sprite.isdown = true;
|
|
3174
|
-
sprite.texture =
|
|
3284
|
+
sprite.texture = pixi_js.Texture.from("https://pixijs.com/assets/button_down.png");
|
|
3175
3285
|
sprite.alpha = 1;
|
|
3176
3286
|
} else if (event === "pointerup" || event === "pointerupoutside") {
|
|
3177
3287
|
sprite.isdown = false;
|
|
3178
3288
|
if (sprite.isOver) {
|
|
3179
|
-
sprite.texture =
|
|
3289
|
+
sprite.texture = pixi_js.Texture.from("https://pixijs.com/assets/button_over.png");
|
|
3180
3290
|
} else {
|
|
3181
|
-
sprite.texture =
|
|
3291
|
+
sprite.texture = pixi_js.Texture.from("https://pixijs.com/assets/button.png");
|
|
3182
3292
|
}
|
|
3183
3293
|
} else if (event === "pointerover") {
|
|
3184
3294
|
sprite.isOver = true;
|
|
3185
3295
|
if (sprite.isdown) {
|
|
3186
3296
|
return;
|
|
3187
3297
|
}
|
|
3188
|
-
sprite.texture =
|
|
3298
|
+
sprite.texture = pixi_js.Texture.from("https://pixijs.com/assets/button_over.png");
|
|
3189
3299
|
} else if (event === "pointerout") {
|
|
3190
3300
|
sprite.isOver = false;
|
|
3191
3301
|
if (sprite.isdown) {
|
|
3192
3302
|
return;
|
|
3193
3303
|
}
|
|
3194
|
-
sprite.texture =
|
|
3304
|
+
sprite.texture = pixi_js.Texture.from("https://pixijs.com/assets/button.png");
|
|
3195
3305
|
}
|
|
3196
3306
|
}
|
|
3197
3307
|
};
|
|
@@ -3213,6 +3323,7 @@ var canvasEventsTestLabel = newLabel(
|
|
|
3213
3323
|
});
|
|
3214
3324
|
const texture = yield pixi_js.Assets.load(bunnyImage);
|
|
3215
3325
|
const sprite = CanvasSprite.from(texture);
|
|
3326
|
+
sprite.scale.set(3);
|
|
3216
3327
|
sprite.anchor.set(0.5);
|
|
3217
3328
|
sprite.x = GameWindowManager.screen.width / 2;
|
|
3218
3329
|
sprite.y = GameWindowManager.screen.height / 2;
|
|
@@ -3228,12 +3339,11 @@ var canvasEventsTestLabel = newLabel(
|
|
|
3228
3339
|
text: `This is the test of buttons in a canvas. (This example is from the official [PixiJS website](https://pixijs.com/8.x/examples/events/interactivity).)`
|
|
3229
3340
|
});
|
|
3230
3341
|
const backgroundT = yield pixi_js.Assets.load("https://pixijs.com/assets/bg_button.jpg");
|
|
3231
|
-
const background = CanvasSprite
|
|
3342
|
+
const background = new CanvasSprite(backgroundT);
|
|
3232
3343
|
background.width = GameWindowManager.screen.width;
|
|
3233
3344
|
background.height = GameWindowManager.screen.height;
|
|
3234
3345
|
GameWindowManager.addCanvasElement("bg", background);
|
|
3235
|
-
const
|
|
3236
|
-
const textureButton = CanvasSprite.from(textureButtonT);
|
|
3346
|
+
const textureButton = yield pixi_js.Assets.load("https://pixijs.com/assets/button.png");
|
|
3237
3347
|
const buttons = [];
|
|
3238
3348
|
const buttonPositions = [175, 75, 655, 75, 410, 325, 150, 465, 685, 445];
|
|
3239
3349
|
for (let i = 0; i < 5; i++) {
|
|
@@ -3253,7 +3363,17 @@ var canvasEventsTestLabel = newLabel(
|
|
|
3253
3363
|
buttons[4].scale.set(0.8, 1.2);
|
|
3254
3364
|
buttons[4].rotation = Math.PI;
|
|
3255
3365
|
})
|
|
3256
|
-
]
|
|
3366
|
+
],
|
|
3367
|
+
{
|
|
3368
|
+
onLoadStep: () => __async(void 0, null, function* () {
|
|
3369
|
+
yield pixi_js.Assets.load([
|
|
3370
|
+
"https://pixijs.com/assets/bg_button.jpg",
|
|
3371
|
+
"https://pixijs.com/assets/button.png",
|
|
3372
|
+
"https://pixijs.com/assets/button_down.png",
|
|
3373
|
+
"https://pixijs.com/assets/button_over.png"
|
|
3374
|
+
]);
|
|
3375
|
+
})
|
|
3376
|
+
}
|
|
3257
3377
|
);
|
|
3258
3378
|
var AlienTintingTest = class extends CanvasSprite {
|
|
3259
3379
|
constructor() {
|
|
@@ -3373,13 +3493,13 @@ var imagesAnimationsTest = newLabel(IMAGE_ANIMAIONS_TEST_LABEL, [
|
|
|
3373
3493
|
() => __async(void 0, null, function* () {
|
|
3374
3494
|
setDialogue({ character: juliette, text: "Here's what they can do." });
|
|
3375
3495
|
setChoiceMenuOptions([
|
|
3376
|
-
new ChoiceMenuOption("Dissolve effect", imagesDissolveTest),
|
|
3377
|
-
new ChoiceMenuOption("Fade effect", imagesFadeTest),
|
|
3378
|
-
new ChoiceMenuOption("Rotate", imagesRotateTest),
|
|
3379
|
-
new ChoiceMenuOption("Move", imagesMoveTest),
|
|
3380
|
-
new ChoiceMenuOption("Zoom", imagesZoomTest),
|
|
3381
|
-
new ChoiceMenuOption("Move in/out", imagesMoveInOutTest),
|
|
3382
|
-
new ChoiceMenuOption("Zoom in/out", imagesZoomInOutTest),
|
|
3496
|
+
new ChoiceMenuOption("Dissolve effect", imagesDissolveTest, {}),
|
|
3497
|
+
new ChoiceMenuOption("Fade effect", imagesFadeTest, {}),
|
|
3498
|
+
new ChoiceMenuOption("Rotate", imagesRotateTest, {}),
|
|
3499
|
+
new ChoiceMenuOption("Move", imagesMoveTest, {}),
|
|
3500
|
+
new ChoiceMenuOption("Zoom", imagesZoomTest, {}),
|
|
3501
|
+
new ChoiceMenuOption("Move in/out", imagesMoveInOutTest, {}),
|
|
3502
|
+
new ChoiceMenuOption("Zoom in/out", imagesZoomInOutTest, {}),
|
|
3383
3503
|
new ChoiceMenuOptionClose("Cancel", true)
|
|
3384
3504
|
]);
|
|
3385
3505
|
}),
|
|
@@ -3489,8 +3609,8 @@ var imagesRotateTest = newLabel("___pixi_vn_images_rotate_test___", [
|
|
|
3489
3609
|
text: `Here's what's going to happen:
|
|
3490
3610
|
- ${eggHeadName} will rotate with a anchor set to 0.
|
|
3491
3611
|
- ${flowerTopName} will rotate with a anchor set to 0.5 and a exponential speed progression.
|
|
3492
|
-
- ${helmlokName} will rotate with a anchor set to 0.5, rotate 2
|
|
3493
|
-
- ${skullyName} will rotate with a anchor set to 1, rotate 3
|
|
3612
|
+
- ${helmlokName} will rotate with a anchor set to 0.5, rotate clockwise for 2 seconds, rotate counterclockwise with a exponential (-0.05) speed progression, and when it reaches 0, it will repeat.
|
|
3613
|
+
- ${skullyName} will rotate with a anchor set to 1, rotate 3 seconds clockwise, wait for 0.5 seconds, and rotate 7 seconds counterclockwise.`
|
|
3494
3614
|
});
|
|
3495
3615
|
let eggHead = GameWindowManager.getCanvasElement("eggHead");
|
|
3496
3616
|
if (eggHead)
|
|
@@ -3543,10 +3663,10 @@ var imagesMoveTest = newLabel("___pixi_vn_images_move_test___", [
|
|
|
3543
3663
|
setDialogue({
|
|
3544
3664
|
character: juliette,
|
|
3545
3665
|
text: `Here's what's going to happen:
|
|
3546
|
-
- ${eggHeadName} will move to { x: 500, y: 100 } with a speed of
|
|
3547
|
-
- ${flowerTopName} will move to { x: 500, y: 300 } with a speed of
|
|
3548
|
-
- ${helmlokName} will move to
|
|
3549
|
-
- ${skullyName} will move to { x: 500, y: 500 } with a speed of
|
|
3666
|
+
- ${eggHeadName} will move to { x: 500, y: 100 } with a speed of 24.
|
|
3667
|
+
- ${flowerTopName} will move to { x: 500, y: 300 } with a speed of 18.
|
|
3668
|
+
- ${helmlokName} will move to { x: 100, y: 500 } with a speed of 150 and a linear speed progression of -2 ( limit 10 ), and then move to { x: 1700, y: 500 } with a speed of 10 and a linear speed progression of 2 ( limit 150 ), and repeat.
|
|
3669
|
+
- ${skullyName} will move to { x: 500, y: 500 } with a speed of 40, wait for 0.5 seconds, and move to { x: 100, y: 100 } with a speed of 40.`
|
|
3550
3670
|
});
|
|
3551
3671
|
GameWindowManager.addTicker("eggHead", new MoveTicker({
|
|
3552
3672
|
destination: { x: 500, y: 100 },
|
|
@@ -3559,25 +3679,25 @@ var imagesMoveTest = newLabel("___pixi_vn_images_move_test___", [
|
|
|
3559
3679
|
GameWindowManager.addTickersSteps("helmlok", [
|
|
3560
3680
|
new MoveTicker({
|
|
3561
3681
|
destination: { x: 100, y: 500 },
|
|
3562
|
-
speed:
|
|
3563
|
-
speedProgression: { type: "linear", amt: -
|
|
3682
|
+
speed: 150,
|
|
3683
|
+
speedProgression: { type: "linear", amt: -2, limit: 10 }
|
|
3564
3684
|
}),
|
|
3565
3685
|
new MoveTicker({
|
|
3566
3686
|
destination: { x: 1700, y: 500 },
|
|
3567
|
-
speed:
|
|
3568
|
-
speedProgression: { type: "linear", amt:
|
|
3687
|
+
speed: 10,
|
|
3688
|
+
speedProgression: { type: "linear", amt: 2, limit: 150 }
|
|
3569
3689
|
}),
|
|
3570
3690
|
Repeat
|
|
3571
3691
|
]);
|
|
3572
3692
|
GameWindowManager.addTickersSteps("skully", [
|
|
3573
3693
|
new MoveTicker({
|
|
3574
3694
|
destination: { x: 500, y: 500 },
|
|
3575
|
-
speed:
|
|
3695
|
+
speed: 40
|
|
3576
3696
|
}),
|
|
3577
3697
|
Pause(0.5),
|
|
3578
3698
|
new MoveTicker({
|
|
3579
3699
|
destination: { x: 100, y: 100 },
|
|
3580
|
-
speed:
|
|
3700
|
+
speed: 40
|
|
3581
3701
|
})
|
|
3582
3702
|
]);
|
|
3583
3703
|
}
|
|
@@ -3639,37 +3759,45 @@ var imagesMoveInOutTest = newLabel("___pixi_vn_images_move_in_out_test___", [
|
|
|
3639
3759
|
setDialogue({
|
|
3640
3760
|
character: juliette,
|
|
3641
3761
|
text: `Here's what's going to happen:
|
|
3642
|
-
- ${eggHeadName} will move in from the top with a speed of
|
|
3643
|
-
- ${flowerTopName} will move in from the right with a speed of
|
|
3644
|
-
- ${helmlokName} will move in from the left with a speed of
|
|
3645
|
-
- ${skullyName} will move in from the bottom with a speed of
|
|
3762
|
+
- ${eggHeadName} will move in from the top with a speed of 80. If you go next, ${eggHeadName} will move out from the bottom with a speed of 80.
|
|
3763
|
+
- ${flowerTopName} will move in from the right with a speed of 80 and a speed progression of 0.02. If you go next, ${flowerTopName} will move out from the left with a speed of 80 and a speed progression of 0.02.
|
|
3764
|
+
- ${helmlokName} will move in from the left with a speed of 80. If you go next, ${helmlokName} will move out from the right with a speed of 80.
|
|
3765
|
+
- ${skullyName} will move in from the bottom with a speed of 80 and a speed progression of 0.02. If you go next, ${skullyName} will move out from the top with a speed of 80 and a speed progression of 0.02.`
|
|
3646
3766
|
});
|
|
3647
3767
|
let eggHead = new CanvasImage({ x: 100, y: 100 }, eggHeadImage);
|
|
3648
3768
|
let flowerTop = new CanvasImage({ x: 300, y: 100 }, flowerTopImage);
|
|
3649
3769
|
let helmlok = new CanvasImage({ x: 100, y: 300 }, helmlokImage);
|
|
3650
3770
|
let skully = new CanvasImage({ x: 300, y: 300 }, skullyImage);
|
|
3651
|
-
moveIn("eggHead", eggHead, { speed:
|
|
3771
|
+
moveIn("eggHead", eggHead, { speed: 80, direction: "down" });
|
|
3652
3772
|
moveIn("flowerTop", flowerTop, {
|
|
3653
|
-
speed:
|
|
3773
|
+
speed: 80,
|
|
3654
3774
|
direction: "left",
|
|
3655
3775
|
speedProgression: { type: "exponential", percentage: 0.02 }
|
|
3656
3776
|
});
|
|
3657
|
-
moveIn("helmlok", helmlok, { speed:
|
|
3777
|
+
moveIn("helmlok", helmlok, { speed: 80, direction: "right" });
|
|
3658
3778
|
moveIn("skully", skully, {
|
|
3659
|
-
speed:
|
|
3779
|
+
speed: 80,
|
|
3660
3780
|
direction: "up",
|
|
3661
3781
|
speedProgression: { type: "exponential", percentage: 0.02 }
|
|
3662
3782
|
});
|
|
3663
3783
|
}),
|
|
3664
3784
|
() => {
|
|
3665
|
-
moveOut("eggHead", { speed:
|
|
3666
|
-
moveOut("flowerTop", { speed:
|
|
3667
|
-
moveOut("helmlok", { speed:
|
|
3668
|
-
moveOut("skully", { speed:
|
|
3785
|
+
moveOut("eggHead", { speed: 80, direction: "down" });
|
|
3786
|
+
moveOut("flowerTop", { speed: 80, direction: "left" });
|
|
3787
|
+
moveOut("helmlok", { speed: 80, direction: "right" });
|
|
3788
|
+
moveOut("skully", { speed: 80, direction: "up" });
|
|
3669
3789
|
}
|
|
3670
3790
|
]);
|
|
3671
3791
|
var imagesZoomInOutTest = newLabel("___pixi_vn_images_zoom_in_out_test___", [
|
|
3672
3792
|
() => __async(void 0, null, function* () {
|
|
3793
|
+
setDialogue({
|
|
3794
|
+
character: juliette,
|
|
3795
|
+
text: `Here's what's going to happen:
|
|
3796
|
+
- ${eggHeadName} will zoom in with a speed of 3. If you go next, ${eggHeadName} will zoom out with a speed of 3.
|
|
3797
|
+
- ${flowerTopName} will zoom in with a speed of 3 and a speed progression of 0.02. If you go next, ${flowerTopName} will zoom out with a speed of 3.
|
|
3798
|
+
- ${helmlokName} will zoom in with a speed of 3. If you go next, ${helmlokName} will zoom out with a speed of 1.
|
|
3799
|
+
- ${skullyName} will zoom in with a speed of 3 and a speed progression of 0.02. If you go next, ${skullyName} will zoom out with a speed of 3 and a speed progression of 0.02.`
|
|
3800
|
+
});
|
|
3673
3801
|
GameWindowManager.removeCanvasElements();
|
|
3674
3802
|
let eggHead = new CanvasImage({ x: 100, y: 100 }, eggHeadImage);
|
|
3675
3803
|
let flowerTop = new CanvasImage({ x: 300, y: 100 }, flowerTopImage);
|
|
@@ -3695,7 +3823,7 @@ var imagesZoomInOutTest = newLabel("___pixi_vn_images_zoom_in_out_test___", [
|
|
|
3695
3823
|
speedProgression: { type: "exponential", percentage: 0.02 }
|
|
3696
3824
|
});
|
|
3697
3825
|
zoomOut("flowerTop", { speed: 3, direction: "left" });
|
|
3698
|
-
zoomOut("helmlok", { speed:
|
|
3826
|
+
zoomOut("helmlok", { speed: 1, direction: "right" });
|
|
3699
3827
|
zoomOut("skully", {
|
|
3700
3828
|
speed: 3,
|
|
3701
3829
|
direction: "up",
|
|
@@ -3777,6 +3905,23 @@ Footer
|
|
|
3777
3905
|
})
|
|
3778
3906
|
]);
|
|
3779
3907
|
|
|
3908
|
+
// src/labels/StepLabelTest.ts
|
|
3909
|
+
var STEP_LABEL_TEST_LABEL = "___pixi_vn_step_label_test___";
|
|
3910
|
+
var stepLabelTestLAbel = newLabel(STEP_LABEL_TEST_LABEL, [
|
|
3911
|
+
() => __async(void 0, null, function* () {
|
|
3912
|
+
setDialogue({ character: juliette, text: `Pixi'VN manages the succession of "screens" with steps. Each step is a function that can be asynchronous.` });
|
|
3913
|
+
}),
|
|
3914
|
+
() => __async(void 0, null, function* () {
|
|
3915
|
+
setDialogue({ character: juliette, text: "The labels are containers of steps, they are used to organize the steps in a more readable way. For start a steps sequence, you must call or jump to a label." });
|
|
3916
|
+
}),
|
|
3917
|
+
() => __async(void 0, null, function* () {
|
|
3918
|
+
setDialogue({ character: juliette, text: "It is also possible to ask the player to make a choice." });
|
|
3919
|
+
}),
|
|
3920
|
+
() => __async(void 0, null, function* () {
|
|
3921
|
+
setDialogue({ character: juliette, text: "Browsing through available tests is one way to test the steps/labels system." });
|
|
3922
|
+
})
|
|
3923
|
+
]);
|
|
3924
|
+
|
|
3780
3925
|
// src/labels/StartLabel.ts
|
|
3781
3926
|
var pixivnTestStartLabel = newLabel(
|
|
3782
3927
|
"___pixi_vn_example_start_label___",
|
|
@@ -3785,25 +3930,25 @@ var pixivnTestStartLabel = newLabel(
|
|
|
3785
3930
|
let currentTimeName = "";
|
|
3786
3931
|
const hour = (/* @__PURE__ */ new Date()).getHours();
|
|
3787
3932
|
if (hour >= 5 && hour < 12) {
|
|
3788
|
-
currentTimeName = "morning";
|
|
3933
|
+
currentTimeName = "morning\u{1F505}";
|
|
3789
3934
|
} else if (hour >= 12 && hour < 18) {
|
|
3790
|
-
currentTimeName = "afternoon";
|
|
3935
|
+
currentTimeName = "afternoon\u{1F506}";
|
|
3791
3936
|
} else if (hour >= 18 && hour < 22) {
|
|
3792
|
-
currentTimeName = "evening";
|
|
3937
|
+
currentTimeName = "evening\u26C5";
|
|
3793
3938
|
} else {
|
|
3794
|
-
currentTimeName = "night";
|
|
3939
|
+
currentTimeName = "night\u{1F319}";
|
|
3795
3940
|
}
|
|
3796
3941
|
setDialogue({ character: juliette, text: `Good ${currentTimeName}! I'm ${juliette.name}, your virtual assistant. I'm here to help you with your tests.` });
|
|
3797
3942
|
},
|
|
3798
|
-
() => setDialogue({ character: juliette, text: `You are running the Pixi\u2019VN test. This test will guide you through the different features of the library.` }),
|
|
3943
|
+
() => setDialogue({ character: juliette, text: `You are running the Pixi\u2019VN v${PIXIVN_VERSION} test. This test will guide you through the different features of the library.` }),
|
|
3799
3944
|
(props) => GameStepManager.jumpLabel(pixivnTestStartLabel2, props)
|
|
3800
3945
|
]
|
|
3801
3946
|
);
|
|
3802
|
-
var
|
|
3803
|
-
"
|
|
3947
|
+
var openLink = newLabel(
|
|
3948
|
+
"___pixi_vn_open_link___",
|
|
3804
3949
|
[
|
|
3805
3950
|
(props) => {
|
|
3806
|
-
window.open(
|
|
3951
|
+
window.open(props.link);
|
|
3807
3952
|
GameStepManager.goNext(props);
|
|
3808
3953
|
}
|
|
3809
3954
|
]
|
|
@@ -3816,12 +3961,14 @@ var pixivnTestStartLabel2 = newLabel(
|
|
|
3816
3961
|
GameWindowManager.clear();
|
|
3817
3962
|
setDialogue({ character: juliette, text: "Which test would you like to start with?" });
|
|
3818
3963
|
setChoiceMenuOptions([
|
|
3819
|
-
new ChoiceMenuOption("Open Pixi\u2019VN Wiki",
|
|
3820
|
-
new ChoiceMenuOption("Images, Transitions and Animations Test", imagesAnimationsTest),
|
|
3821
|
-
new ChoiceMenuOption("Canvas Events Test
|
|
3822
|
-
new ChoiceMenuOption("Base Canvas Element Test", baseCanvasElementTestLabel),
|
|
3823
|
-
new ChoiceMenuOption("Custom Ticker Canvas Element Test", customTickerCanvasElementTestLabel),
|
|
3824
|
-
new ChoiceMenuOption("
|
|
3964
|
+
new ChoiceMenuOption("Open Pixi\u2019VN Wiki", openLink, { link: "https://pixi-vn.web.app/" }),
|
|
3965
|
+
new ChoiceMenuOption("Images, Transitions and Animations Test", imagesAnimationsTest, {}),
|
|
3966
|
+
new ChoiceMenuOption("Canvas Events Test", canvasEventsTestLabel, {}),
|
|
3967
|
+
new ChoiceMenuOption("Base Canvas Element Test", baseCanvasElementTestLabel, {}),
|
|
3968
|
+
new ChoiceMenuOption("Custom Ticker Canvas Element Test", customTickerCanvasElementTestLabel, {}),
|
|
3969
|
+
new ChoiceMenuOption("Steps and Labels Test", stepLabelTestLAbel, {}),
|
|
3970
|
+
new ChoiceMenuOption("Markdown Test", markdownTest, {}),
|
|
3971
|
+
new ChoiceMenuOption("Open Pixi\u2019VN Github Issues", openLink, { link: "https://github.com/DRincs-Productions/pixi-vn/issues" })
|
|
3825
3972
|
]);
|
|
3826
3973
|
},
|
|
3827
3974
|
(props) => GameStepManager.jumpLabel(RESTART_TEST_LABEL, props)
|