@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
|
@@ -127,8 +127,6 @@ function getMemoryContainer(element) {
|
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
function setMemoryContainer(element, memory) {
|
|
130
|
-
memory.width && (element.width = memory.width);
|
|
131
|
-
memory.height && (element.height = memory.height);
|
|
132
130
|
memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
|
|
133
131
|
memory.blendMode && (element.blendMode = memory.blendMode);
|
|
134
132
|
memory.tint && (element.tint = memory.tint);
|
|
@@ -161,6 +159,8 @@ function setMemoryContainer(element, memory) {
|
|
|
161
159
|
memory.interactive && (element.interactive = memory.interactive);
|
|
162
160
|
memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
|
|
163
161
|
memory.hitArea && (element.hitArea = memory.hitArea);
|
|
162
|
+
memory.width && (element.width = memory.width);
|
|
163
|
+
memory.height && (element.height = memory.height);
|
|
164
164
|
}
|
|
165
165
|
function getTexture(imageUrl) {
|
|
166
166
|
return __async(this, null, function* () {
|
|
@@ -553,19 +553,18 @@ function checkIfStepsIsEqual(step1, step2) {
|
|
|
553
553
|
return step1 === step2;
|
|
554
554
|
}
|
|
555
555
|
|
|
556
|
-
// src/classes/
|
|
557
|
-
var
|
|
556
|
+
// src/classes/LabelAbstract.ts
|
|
557
|
+
var LabelAbstract = class {
|
|
558
558
|
/**
|
|
559
559
|
* @param id is the id of the label
|
|
560
|
-
* @param
|
|
561
|
-
* @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
|
|
562
|
-
* @param choiseIndex is the index of the choice that the label will perform
|
|
560
|
+
* @param props is the properties of the label
|
|
563
561
|
*/
|
|
564
|
-
constructor(id,
|
|
562
|
+
constructor(id, props) {
|
|
565
563
|
this._id = id;
|
|
566
|
-
this.
|
|
567
|
-
this.
|
|
568
|
-
this.
|
|
564
|
+
this._onStepStart = props == null ? void 0 : props.onStepStart;
|
|
565
|
+
this._onLoadStep = props == null ? void 0 : props.onLoadStep;
|
|
566
|
+
this._onStepEnd = props == null ? void 0 : props.onStepEnd;
|
|
567
|
+
this._choiseIndex = props == null ? void 0 : props.choiseIndex;
|
|
569
568
|
}
|
|
570
569
|
/**
|
|
571
570
|
* Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
|
|
@@ -573,17 +572,6 @@ var Label = class {
|
|
|
573
572
|
get id() {
|
|
574
573
|
return this._id;
|
|
575
574
|
}
|
|
576
|
-
/**
|
|
577
|
-
* Get the steps of the label.
|
|
578
|
-
* This class should be extended and the steps method should be overridden.
|
|
579
|
-
* Every time you update this list will also be updated when the other game versions load.
|
|
580
|
-
*/
|
|
581
|
-
get steps() {
|
|
582
|
-
if (typeof this._steps === "function") {
|
|
583
|
-
return this._steps();
|
|
584
|
-
}
|
|
585
|
-
return this._steps;
|
|
586
|
-
}
|
|
587
575
|
/**
|
|
588
576
|
* Get the corresponding steps number
|
|
589
577
|
* @param externalSteps
|
|
@@ -602,33 +590,171 @@ var Label = class {
|
|
|
602
590
|
return res;
|
|
603
591
|
}
|
|
604
592
|
/**
|
|
605
|
-
*
|
|
593
|
+
* 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.
|
|
606
594
|
* @returns Promise<void> or void
|
|
607
|
-
* @example
|
|
608
|
-
* ```typescript
|
|
609
|
-
* newLabel("id", [], () => {
|
|
610
|
-
* Assets.load('path/to/image1.png')
|
|
611
|
-
* Assets.load('path/to/image2.png')
|
|
612
|
-
* })
|
|
613
|
-
* ```
|
|
614
595
|
*/
|
|
615
|
-
get
|
|
616
|
-
return this
|
|
596
|
+
get onStepStart() {
|
|
597
|
+
return (stepIndex, label) => __async(this, null, function* () {
|
|
598
|
+
if (this._onLoadStep) {
|
|
599
|
+
yield this._onLoadStep(stepIndex, label);
|
|
600
|
+
}
|
|
601
|
+
if (this._onStepStart) {
|
|
602
|
+
return yield this._onStepStart(stepIndex, label);
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* 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.
|
|
608
|
+
* @returns Promise<void> or void
|
|
609
|
+
*/
|
|
610
|
+
get onLoadStep() {
|
|
611
|
+
return this._onLoadStep;
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Is a function that will be executed when the step ends.
|
|
615
|
+
* @returns Promise<void> or void
|
|
616
|
+
*/
|
|
617
|
+
get onStepEnd() {
|
|
618
|
+
return this._onStepEnd;
|
|
617
619
|
}
|
|
618
620
|
get choiseIndex() {
|
|
619
621
|
return this._choiseIndex;
|
|
620
622
|
}
|
|
621
623
|
};
|
|
622
624
|
|
|
625
|
+
// src/classes/Label.ts
|
|
626
|
+
var Label = class extends LabelAbstract {
|
|
627
|
+
/**
|
|
628
|
+
* @param id is the id of the label
|
|
629
|
+
* @param steps is the list of steps that the label will perform
|
|
630
|
+
* @param props is the properties of the label
|
|
631
|
+
*/
|
|
632
|
+
constructor(id, steps, props) {
|
|
633
|
+
super(id, props);
|
|
634
|
+
this._steps = steps;
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Get the steps of the label.
|
|
638
|
+
*/
|
|
639
|
+
get steps() {
|
|
640
|
+
if (typeof this._steps === "function") {
|
|
641
|
+
return this._steps();
|
|
642
|
+
}
|
|
643
|
+
return this._steps;
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
|
|
623
647
|
// src/classes/CloseLabel.ts
|
|
624
648
|
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
625
649
|
function newCloseLabel(choiseIndex) {
|
|
626
|
-
return new Label(CLOSE_LABEL_ID, [],
|
|
650
|
+
return new Label(CLOSE_LABEL_ID, [], {
|
|
651
|
+
choiseIndex
|
|
652
|
+
});
|
|
627
653
|
}
|
|
628
654
|
|
|
629
655
|
// src/types/CloseType.ts
|
|
630
656
|
var Close = "close";
|
|
631
657
|
|
|
658
|
+
// src/classes/ChoiceMenuOption.ts
|
|
659
|
+
var ChoiceMenuOption = class {
|
|
660
|
+
/**
|
|
661
|
+
* @param text Text to be displayed in the menu
|
|
662
|
+
* @param label Label to be opened when the option is selected or the id of the label
|
|
663
|
+
* @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.
|
|
664
|
+
* @param type Type of the label to be opened. @default "call"
|
|
665
|
+
*/
|
|
666
|
+
constructor(text, label, props, type = "call") {
|
|
667
|
+
/**
|
|
668
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
669
|
+
* @example
|
|
670
|
+
* ```tsx
|
|
671
|
+
* setChoiceMenuOptions([
|
|
672
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
673
|
+
* ])
|
|
674
|
+
* return <List>
|
|
675
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
676
|
+
* return (
|
|
677
|
+
* <ChoiceButton
|
|
678
|
+
* disabled={item.props.disabled}
|
|
679
|
+
* onClick={() => {
|
|
680
|
+
* afterSelectChoice(item)
|
|
681
|
+
* }}
|
|
682
|
+
* >
|
|
683
|
+
* {item.text}
|
|
684
|
+
* </ChoiceButton>
|
|
685
|
+
* )
|
|
686
|
+
* })}
|
|
687
|
+
* </List>
|
|
688
|
+
* ```
|
|
689
|
+
*/
|
|
690
|
+
this.props = {};
|
|
691
|
+
this.text = text;
|
|
692
|
+
this._label = label;
|
|
693
|
+
this.type = type;
|
|
694
|
+
if (props) {
|
|
695
|
+
this.props = props;
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* Label to be opened when the option is selected
|
|
700
|
+
*/
|
|
701
|
+
get label() {
|
|
702
|
+
let label = this._label;
|
|
703
|
+
if (typeof label === "string") {
|
|
704
|
+
let res = getLabelById(label);
|
|
705
|
+
if (res) {
|
|
706
|
+
label = res;
|
|
707
|
+
} else {
|
|
708
|
+
console.error(`Label ${label} not found, so it will be closed`);
|
|
709
|
+
label = newCloseLabel();
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
return label;
|
|
713
|
+
}
|
|
714
|
+
};
|
|
715
|
+
var ChoiceMenuOptionClose = class {
|
|
716
|
+
/**
|
|
717
|
+
* @param text Text to be displayed in the menu
|
|
718
|
+
* @param closeCurrentLabel If true, the current label will be closed. @default false
|
|
719
|
+
*/
|
|
720
|
+
constructor(text, closeCurrentLabel = false) {
|
|
721
|
+
/**
|
|
722
|
+
* Label to be opened when the option is selected
|
|
723
|
+
*/
|
|
724
|
+
this.label = newCloseLabel();
|
|
725
|
+
/**
|
|
726
|
+
* Type of the label to be opened
|
|
727
|
+
*/
|
|
728
|
+
this.type = Close;
|
|
729
|
+
/**
|
|
730
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
731
|
+
* @example
|
|
732
|
+
* ```tsx
|
|
733
|
+
* setChoiceMenuOptions([
|
|
734
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
735
|
+
* ])
|
|
736
|
+
* return <List>
|
|
737
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
738
|
+
* return (
|
|
739
|
+
* <ChoiceButton
|
|
740
|
+
* disabled={item.props.disabled}
|
|
741
|
+
* onClick={() => {
|
|
742
|
+
* afterSelectChoice(item)
|
|
743
|
+
* }}
|
|
744
|
+
* >
|
|
745
|
+
* {item.text}
|
|
746
|
+
* </ChoiceButton>
|
|
747
|
+
* )
|
|
748
|
+
* })}
|
|
749
|
+
* </List>
|
|
750
|
+
* ```
|
|
751
|
+
*/
|
|
752
|
+
this.props = {};
|
|
753
|
+
this.text = text;
|
|
754
|
+
this.closeCurrentLabel = closeCurrentLabel;
|
|
755
|
+
}
|
|
756
|
+
};
|
|
757
|
+
|
|
632
758
|
// src/functions/DialogueUtility.ts
|
|
633
759
|
function setDialogue(props) {
|
|
634
760
|
let text = "";
|
|
@@ -663,21 +789,18 @@ function getChoiceMenuOptions() {
|
|
|
663
789
|
d.forEach((option, index) => {
|
|
664
790
|
if (option.type === Close) {
|
|
665
791
|
let itemLabel = newCloseLabel(index);
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
type: Close,
|
|
670
|
-
closeCurrentLabel: option.closeCurrentLabel,
|
|
671
|
-
props: {}
|
|
672
|
-
});
|
|
792
|
+
let choice = new ChoiceMenuOptionClose(option.text, option.closeCurrentLabel);
|
|
793
|
+
choice.label = itemLabel;
|
|
794
|
+
options.push(choice);
|
|
673
795
|
return;
|
|
674
796
|
}
|
|
675
797
|
let label = getLabelById(option.label);
|
|
676
798
|
if (label) {
|
|
677
|
-
let itemLabel = new Label(label.id, label.steps,
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
})
|
|
799
|
+
let itemLabel = new Label(label.id, label.steps, {
|
|
800
|
+
onStepStart: label.onStepStart,
|
|
801
|
+
choiseIndex: index
|
|
802
|
+
});
|
|
803
|
+
options.push(new ChoiceMenuOption(option.text, itemLabel, option.props, option.type));
|
|
681
804
|
}
|
|
682
805
|
});
|
|
683
806
|
return options;
|
|
@@ -765,8 +888,9 @@ FadeAlphaTicker = __decorateClass([
|
|
|
765
888
|
], FadeAlphaTicker);
|
|
766
889
|
|
|
767
890
|
// src/functions/TickerUtility.ts
|
|
768
|
-
function updateTickerProgression(args, propertyName, progression) {
|
|
769
|
-
|
|
891
|
+
function updateTickerProgression(args, propertyName, progression, valueConvert) {
|
|
892
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
893
|
+
if (args[propertyName] === void 0 || !progression || args[propertyName] === limit) {
|
|
770
894
|
return;
|
|
771
895
|
}
|
|
772
896
|
if (typeof args[propertyName] === "number") {
|
|
@@ -785,22 +909,25 @@ function updateTickerProgression(args, propertyName, progression) {
|
|
|
785
909
|
}
|
|
786
910
|
}
|
|
787
911
|
}
|
|
788
|
-
function getLinearProgression(number, progression) {
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
return
|
|
912
|
+
function getLinearProgression(number, progression, valueConvert) {
|
|
913
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
914
|
+
let amt = valueConvert ? valueConvert(progression.amt) : progression.amt;
|
|
915
|
+
if (limit !== void 0) {
|
|
916
|
+
if (number > limit && amt > 0) {
|
|
917
|
+
return limit;
|
|
918
|
+
} else if (number < limit && amt < 0) {
|
|
919
|
+
return limit;
|
|
794
920
|
}
|
|
795
921
|
}
|
|
796
|
-
return number +
|
|
922
|
+
return number + amt;
|
|
797
923
|
}
|
|
798
|
-
function getExponentialProgression(number, progression) {
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
924
|
+
function getExponentialProgression(number, progression, valueConvert) {
|
|
925
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
926
|
+
if (limit !== void 0) {
|
|
927
|
+
if (number > limit && progression.percentage > 0) {
|
|
928
|
+
return limit;
|
|
929
|
+
} else if (number < limit && progression.percentage < 0) {
|
|
930
|
+
return limit;
|
|
804
931
|
}
|
|
805
932
|
}
|
|
806
933
|
return number + number * progression.percentage;
|
|
@@ -813,15 +940,13 @@ var MoveTicker = class extends TickerBase {
|
|
|
813
940
|
let ySpeed = 1;
|
|
814
941
|
if (args.speed) {
|
|
815
942
|
if (typeof args.speed === "number") {
|
|
816
|
-
xSpeed = args.speed;
|
|
817
|
-
ySpeed = args.speed;
|
|
943
|
+
xSpeed = this.speedConvert(args.speed);
|
|
944
|
+
ySpeed = this.speedConvert(args.speed);
|
|
818
945
|
} else {
|
|
819
|
-
xSpeed = args.speed.x;
|
|
820
|
-
ySpeed = args.speed.y;
|
|
946
|
+
xSpeed = this.speedConvert(args.speed.x);
|
|
947
|
+
ySpeed = this.speedConvert(args.speed.y);
|
|
821
948
|
}
|
|
822
949
|
}
|
|
823
|
-
xSpeed /= 60;
|
|
824
|
-
ySpeed /= 60;
|
|
825
950
|
let destination = args.destination;
|
|
826
951
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
827
952
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
@@ -861,7 +986,10 @@ var MoveTicker = class extends TickerBase {
|
|
|
861
986
|
}
|
|
862
987
|
});
|
|
863
988
|
if (args.speedProgression)
|
|
864
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
989
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
990
|
+
}
|
|
991
|
+
speedConvert(speed) {
|
|
992
|
+
return speed / 6;
|
|
865
993
|
}
|
|
866
994
|
};
|
|
867
995
|
MoveTicker = __decorateClass([
|
|
@@ -869,7 +997,7 @@ MoveTicker = __decorateClass([
|
|
|
869
997
|
], MoveTicker);
|
|
870
998
|
var RotateTicker = class extends TickerBase {
|
|
871
999
|
fn(ticker, args, tags, tickerId) {
|
|
872
|
-
let speed = (args.speed === void 0 ? 1 : args.speed)
|
|
1000
|
+
let speed = this.speedConvert(args.speed === void 0 ? 1 : args.speed);
|
|
873
1001
|
let clockwise = args.clockwise === void 0 ? true : args.clockwise;
|
|
874
1002
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
875
1003
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
@@ -897,7 +1025,10 @@ var RotateTicker = class extends TickerBase {
|
|
|
897
1025
|
}
|
|
898
1026
|
});
|
|
899
1027
|
if (args.speedProgression)
|
|
900
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
1028
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
1029
|
+
}
|
|
1030
|
+
speedConvert(speed) {
|
|
1031
|
+
return speed / 60;
|
|
901
1032
|
}
|
|
902
1033
|
};
|
|
903
1034
|
RotateTicker = __decorateClass([
|
|
@@ -909,15 +1040,13 @@ var ZoomTicker = class extends TickerBase {
|
|
|
909
1040
|
let ySpeed = 0.1;
|
|
910
1041
|
if (args.speed) {
|
|
911
1042
|
if (typeof args.speed === "number") {
|
|
912
|
-
xSpeed = args.speed;
|
|
913
|
-
ySpeed = args.speed;
|
|
1043
|
+
xSpeed = this.speedConvert(args.speed);
|
|
1044
|
+
ySpeed = this.speedConvert(args.speed);
|
|
914
1045
|
} else {
|
|
915
|
-
xSpeed = args.speed.x;
|
|
916
|
-
ySpeed = args.speed.y;
|
|
1046
|
+
xSpeed = this.speedConvert(args.speed.x);
|
|
1047
|
+
ySpeed = this.speedConvert(args.speed.y);
|
|
917
1048
|
}
|
|
918
1049
|
}
|
|
919
|
-
xSpeed /= 60;
|
|
920
|
-
ySpeed /= 60;
|
|
921
1050
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
922
1051
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
923
1052
|
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
@@ -984,7 +1113,10 @@ var ZoomTicker = class extends TickerBase {
|
|
|
984
1113
|
}
|
|
985
1114
|
});
|
|
986
1115
|
if (args.speedProgression)
|
|
987
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
1116
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
1117
|
+
}
|
|
1118
|
+
speedConvert(speed) {
|
|
1119
|
+
return speed / 60;
|
|
988
1120
|
}
|
|
989
1121
|
onEndOfTicker(tag, tickerId, _element, tagToRemoveAfter2) {
|
|
990
1122
|
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
@@ -1974,6 +2106,16 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1974
2106
|
static set originalStepData(value) {
|
|
1975
2107
|
_GameStepManager._originalStepData = createExportableElement(value);
|
|
1976
2108
|
}
|
|
2109
|
+
static get currentStepData() {
|
|
2110
|
+
let currentStepData = {
|
|
2111
|
+
path: window.location.pathname,
|
|
2112
|
+
storage: GameStorageManager.export(),
|
|
2113
|
+
canvas: GameWindowManager.export(),
|
|
2114
|
+
labelIndex: _GameStepManager.currentLabelStepIndex || 0,
|
|
2115
|
+
openedLabels: createExportableElement(_GameStepManager._openedLabels)
|
|
2116
|
+
};
|
|
2117
|
+
return currentStepData;
|
|
2118
|
+
}
|
|
1977
2119
|
/* Edit History Methods */
|
|
1978
2120
|
/**
|
|
1979
2121
|
* Add a label to the history.
|
|
@@ -1981,19 +2123,13 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1981
2123
|
*/
|
|
1982
2124
|
static addStepHistory(step, choiseMade) {
|
|
1983
2125
|
let stepHistory = getStepSha1(step);
|
|
1984
|
-
let
|
|
1985
|
-
path: window.location.pathname,
|
|
1986
|
-
storage: GameStorageManager.export(),
|
|
1987
|
-
canvas: GameWindowManager.export(),
|
|
1988
|
-
labelIndex: _GameStepManager.currentLabelStepIndex || 0,
|
|
1989
|
-
openedLabels: createExportableElement(_GameStepManager._openedLabels)
|
|
1990
|
-
};
|
|
2126
|
+
let currentStepData = _GameStepManager.currentStepData;
|
|
1991
2127
|
if (_GameStepManager.originalStepData) {
|
|
1992
|
-
if (_GameStepManager.originalStepData.openedLabels.length ===
|
|
2128
|
+
if (_GameStepManager.originalStepData.openedLabels.length === currentStepData.openedLabels.length) {
|
|
1993
2129
|
try {
|
|
1994
2130
|
let lastStepDataOpenedLabelsString = JSON.stringify(_GameStepManager.originalStepData.openedLabels);
|
|
1995
|
-
let historyStepOpenedLabelsString = JSON.stringify(
|
|
1996
|
-
if (lastStepDataOpenedLabelsString === historyStepOpenedLabelsString && _GameStepManager.originalStepData.path ===
|
|
2131
|
+
let historyStepOpenedLabelsString = JSON.stringify(currentStepData.openedLabels);
|
|
2132
|
+
if (lastStepDataOpenedLabelsString === historyStepOpenedLabelsString && _GameStepManager.originalStepData.path === currentStepData.path && _GameStepManager.originalStepData.labelIndex === currentStepData.labelIndex) {
|
|
1997
2133
|
return;
|
|
1998
2134
|
}
|
|
1999
2135
|
} catch (e) {
|
|
@@ -2001,7 +2137,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2001
2137
|
}
|
|
2002
2138
|
}
|
|
2003
2139
|
}
|
|
2004
|
-
let data = diff(_GameStepManager.originalStepData,
|
|
2140
|
+
let data = diff(_GameStepManager.originalStepData, currentStepData);
|
|
2005
2141
|
if (data) {
|
|
2006
2142
|
let dialoge = void 0;
|
|
2007
2143
|
let requiredChoices = void 0;
|
|
@@ -2020,7 +2156,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2020
2156
|
index: _GameStepManager.lastStepIndex,
|
|
2021
2157
|
choiceIndexMade: choiseMade
|
|
2022
2158
|
});
|
|
2023
|
-
_GameStepManager.originalStepData =
|
|
2159
|
+
_GameStepManager.originalStepData = currentStepData;
|
|
2024
2160
|
}
|
|
2025
2161
|
_GameStepManager.increaseLastStepIndex();
|
|
2026
2162
|
}
|
|
@@ -2111,6 +2247,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2111
2247
|
console.warn("[Pixi'VN] The player must make a choice");
|
|
2112
2248
|
return;
|
|
2113
2249
|
}
|
|
2250
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2251
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2252
|
+
}
|
|
2114
2253
|
_GameStepManager.increaseCurrentStepIndex();
|
|
2115
2254
|
return yield _GameStepManager.runCurrentStep(props, choiseMade);
|
|
2116
2255
|
});
|
|
@@ -2135,6 +2274,10 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2135
2274
|
return;
|
|
2136
2275
|
}
|
|
2137
2276
|
if (currentLabel.steps.length > currentLabelStepIndex) {
|
|
2277
|
+
let onStepRun = currentLabel.onStepStart;
|
|
2278
|
+
if (onStepRun) {
|
|
2279
|
+
yield onStepRun(currentLabelStepIndex, currentLabel);
|
|
2280
|
+
}
|
|
2138
2281
|
let step = currentLabel.steps[currentLabelStepIndex];
|
|
2139
2282
|
let result = yield step(props);
|
|
2140
2283
|
_GameStepManager.addStepHistory(step, choiseMade);
|
|
@@ -2199,6 +2342,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2199
2342
|
if (!tempLabel) {
|
|
2200
2343
|
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
2201
2344
|
}
|
|
2345
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2346
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2347
|
+
}
|
|
2202
2348
|
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
2203
2349
|
} catch (e) {
|
|
2204
2350
|
console.error("[Pixi'VN] Error calling label", e);
|
|
@@ -2257,6 +2403,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2257
2403
|
if (!tempLabel) {
|
|
2258
2404
|
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
2259
2405
|
}
|
|
2406
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2407
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2408
|
+
}
|
|
2260
2409
|
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
2261
2410
|
} catch (e) {
|
|
2262
2411
|
console.error("[Pixi'VN] Error jumping label", e);
|
|
@@ -2362,24 +2511,29 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2362
2511
|
* ```
|
|
2363
2512
|
*/
|
|
2364
2513
|
static goBack(navigate, steps = 1) {
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2514
|
+
return __async(this, null, function* () {
|
|
2515
|
+
if (steps <= 0) {
|
|
2516
|
+
console.warn("[Pixi'VN] Steps must be greater than 0");
|
|
2517
|
+
return;
|
|
2518
|
+
}
|
|
2519
|
+
if (_GameStepManager._stepsHistory.length <= 1) {
|
|
2520
|
+
console.warn("[Pixi'VN] No steps to go back");
|
|
2521
|
+
return;
|
|
2522
|
+
}
|
|
2523
|
+
let restoredStep = _GameStepManager.goBackInternal(steps, _GameStepManager.originalStepData);
|
|
2524
|
+
if (restoredStep) {
|
|
2525
|
+
_GameStepManager._originalStepData = restoredStep;
|
|
2526
|
+
_GameStepManager._openedLabels = createExportableElement(restoredStep.openedLabels);
|
|
2527
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onLoadStep) {
|
|
2528
|
+
yield _GameStepManager.currentLabel.onLoadStep(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2529
|
+
}
|
|
2530
|
+
GameStorageManager.import(createExportableElement(restoredStep.storage));
|
|
2531
|
+
GameWindowManager.import(createExportableElement(restoredStep.canvas));
|
|
2532
|
+
navigate(restoredStep.path);
|
|
2533
|
+
} else {
|
|
2534
|
+
console.error("[Pixi'VN] Error going back");
|
|
2535
|
+
}
|
|
2536
|
+
});
|
|
2383
2537
|
}
|
|
2384
2538
|
static goBackInternal(steps, restoredStep) {
|
|
2385
2539
|
if (steps <= 0) {
|
|
@@ -2441,38 +2595,45 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2441
2595
|
* @param dataString The history in a JSON string.
|
|
2442
2596
|
*/
|
|
2443
2597
|
static importJson(dataString) {
|
|
2444
|
-
|
|
2598
|
+
return __async(this, null, function* () {
|
|
2599
|
+
yield _GameStepManager.import(JSON.parse(dataString));
|
|
2600
|
+
});
|
|
2445
2601
|
}
|
|
2446
2602
|
/**
|
|
2447
2603
|
* Import the history from an object.
|
|
2448
2604
|
* @param data The history in an object.
|
|
2449
2605
|
*/
|
|
2450
2606
|
static import(data) {
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2607
|
+
return __async(this, null, function* () {
|
|
2608
|
+
_GameStepManager.clear();
|
|
2609
|
+
try {
|
|
2610
|
+
if (data.hasOwnProperty("stepsHistory")) {
|
|
2611
|
+
_GameStepManager._stepsHistory = data["stepsHistory"];
|
|
2612
|
+
} else {
|
|
2613
|
+
console.warn("[Pixi'VN] Could not import stepsHistory data, so will be ignored");
|
|
2614
|
+
}
|
|
2615
|
+
if (data.hasOwnProperty("openedLabels")) {
|
|
2616
|
+
_GameStepManager._openedLabels = data["openedLabels"];
|
|
2617
|
+
} else {
|
|
2618
|
+
console.warn("[Pixi'VN] Could not import openedLabels data, so will be ignored");
|
|
2619
|
+
}
|
|
2620
|
+
if (data.hasOwnProperty("lastStepIndex")) {
|
|
2621
|
+
_GameStepManager._lastStepIndex = data["lastStepIndex"];
|
|
2622
|
+
} else {
|
|
2623
|
+
console.warn("[Pixi'VN] Could not import lastStepIndex data, so will be ignored");
|
|
2624
|
+
}
|
|
2625
|
+
if (data.hasOwnProperty("originalStepData")) {
|
|
2626
|
+
_GameStepManager._originalStepData = data["originalStepData"];
|
|
2627
|
+
} else {
|
|
2628
|
+
console.warn("[Pixi'VN] Could not import originalStepData data, so will be ignored");
|
|
2629
|
+
}
|
|
2630
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onLoadStep) {
|
|
2631
|
+
yield _GameStepManager.currentLabel.onLoadStep(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2632
|
+
}
|
|
2633
|
+
} catch (e) {
|
|
2634
|
+
console.error("[Pixi'VN] Error importing data", e);
|
|
2472
2635
|
}
|
|
2473
|
-
}
|
|
2474
|
-
console.error("[Pixi'VN] Error importing data", e);
|
|
2475
|
-
}
|
|
2636
|
+
});
|
|
2476
2637
|
}
|
|
2477
2638
|
};
|
|
2478
2639
|
/**
|
|
@@ -2646,11 +2807,11 @@ var DialogueBaseModel = class {
|
|
|
2646
2807
|
|
|
2647
2808
|
// src/decorators/LabelDecorator.ts
|
|
2648
2809
|
var registeredLabels = {};
|
|
2649
|
-
function newLabel(id, steps,
|
|
2810
|
+
function newLabel(id, steps, props) {
|
|
2650
2811
|
if (registeredLabels[id]) {
|
|
2651
2812
|
console.info(`[Pixi'VN] Label ${id} already exists, it will be overwritten`);
|
|
2652
2813
|
}
|
|
2653
|
-
let label = new Label(id, steps,
|
|
2814
|
+
let label = new Label(id, steps, props);
|
|
2654
2815
|
registeredLabels[id] = label;
|
|
2655
2816
|
return label;
|
|
2656
2817
|
}
|
|
@@ -2667,7 +2828,7 @@ function getLabelById(id) {
|
|
|
2667
2828
|
var juliette = new CharacterBaseModel2("___pixivn_juliette___", {
|
|
2668
2829
|
name: "Juliette",
|
|
2669
2830
|
age: 25,
|
|
2670
|
-
icon: "https://firebasestorage.googleapis.com/v0/b/pixi-vn.appspot.com/o/public%2Fcharacters%2Fjuliette-square.webp?alt=media
|
|
2831
|
+
icon: "https://firebasestorage.googleapis.com/v0/b/pixi-vn.appspot.com/o/public%2Fcharacters%2Fjuliette-square.webp?alt=media",
|
|
2671
2832
|
color: "#ac0086"
|
|
2672
2833
|
});
|
|
2673
2834
|
saveCharacter(juliette);
|