@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
|
@@ -503,8 +503,6 @@ function getMemoryContainer(element) {
|
|
|
503
503
|
};
|
|
504
504
|
}
|
|
505
505
|
function setMemoryContainer(element, memory) {
|
|
506
|
-
memory.width && (element.width = memory.width);
|
|
507
|
-
memory.height && (element.height = memory.height);
|
|
508
506
|
memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
|
|
509
507
|
memory.blendMode && (element.blendMode = memory.blendMode);
|
|
510
508
|
memory.tint && (element.tint = memory.tint);
|
|
@@ -537,6 +535,8 @@ function setMemoryContainer(element, memory) {
|
|
|
537
535
|
memory.interactive && (element.interactive = memory.interactive);
|
|
538
536
|
memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
|
|
539
537
|
memory.hitArea && (element.hitArea = memory.hitArea);
|
|
538
|
+
memory.width && (element.width = memory.width);
|
|
539
|
+
memory.height && (element.height = memory.height);
|
|
540
540
|
}
|
|
541
541
|
|
|
542
542
|
// src/decorators/CharacterDecorator.ts
|
|
@@ -559,19 +559,18 @@ function checkIfStepsIsEqual(step1, step2) {
|
|
|
559
559
|
return step1 === step2;
|
|
560
560
|
}
|
|
561
561
|
|
|
562
|
-
// src/classes/
|
|
563
|
-
var
|
|
562
|
+
// src/classes/LabelAbstract.ts
|
|
563
|
+
var LabelAbstract = class {
|
|
564
564
|
/**
|
|
565
565
|
* @param id is the id of the label
|
|
566
|
-
* @param
|
|
567
|
-
* @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
|
|
568
|
-
* @param choiseIndex is the index of the choice that the label will perform
|
|
566
|
+
* @param props is the properties of the label
|
|
569
567
|
*/
|
|
570
|
-
constructor(id,
|
|
568
|
+
constructor(id, props) {
|
|
571
569
|
this._id = id;
|
|
572
|
-
this.
|
|
573
|
-
this.
|
|
574
|
-
this.
|
|
570
|
+
this._onStepStart = props == null ? void 0 : props.onStepStart;
|
|
571
|
+
this._onLoadStep = props == null ? void 0 : props.onLoadStep;
|
|
572
|
+
this._onStepEnd = props == null ? void 0 : props.onStepEnd;
|
|
573
|
+
this._choiseIndex = props == null ? void 0 : props.choiseIndex;
|
|
575
574
|
}
|
|
576
575
|
/**
|
|
577
576
|
* Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
|
|
@@ -579,17 +578,6 @@ var Label = class {
|
|
|
579
578
|
get id() {
|
|
580
579
|
return this._id;
|
|
581
580
|
}
|
|
582
|
-
/**
|
|
583
|
-
* Get the steps of the label.
|
|
584
|
-
* This class should be extended and the steps method should be overridden.
|
|
585
|
-
* Every time you update this list will also be updated when the other game versions load.
|
|
586
|
-
*/
|
|
587
|
-
get steps() {
|
|
588
|
-
if (typeof this._steps === "function") {
|
|
589
|
-
return this._steps();
|
|
590
|
-
}
|
|
591
|
-
return this._steps;
|
|
592
|
-
}
|
|
593
581
|
/**
|
|
594
582
|
* Get the corresponding steps number
|
|
595
583
|
* @param externalSteps
|
|
@@ -608,33 +596,171 @@ var Label = class {
|
|
|
608
596
|
return res;
|
|
609
597
|
}
|
|
610
598
|
/**
|
|
611
|
-
*
|
|
599
|
+
* 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.
|
|
600
|
+
* @returns Promise<void> or void
|
|
601
|
+
*/
|
|
602
|
+
get onStepStart() {
|
|
603
|
+
return (stepIndex, label) => __async(this, null, function* () {
|
|
604
|
+
if (this._onLoadStep) {
|
|
605
|
+
yield this._onLoadStep(stepIndex, label);
|
|
606
|
+
}
|
|
607
|
+
if (this._onStepStart) {
|
|
608
|
+
return yield this._onStepStart(stepIndex, label);
|
|
609
|
+
}
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* 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.
|
|
614
|
+
* @returns Promise<void> or void
|
|
615
|
+
*/
|
|
616
|
+
get onLoadStep() {
|
|
617
|
+
return this._onLoadStep;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Is a function that will be executed when the step ends.
|
|
612
621
|
* @returns Promise<void> or void
|
|
613
|
-
* @example
|
|
614
|
-
* ```typescript
|
|
615
|
-
* newLabel("id", [], () => {
|
|
616
|
-
* Assets.load('path/to/image1.png')
|
|
617
|
-
* Assets.load('path/to/image2.png')
|
|
618
|
-
* })
|
|
619
|
-
* ```
|
|
620
622
|
*/
|
|
621
|
-
get
|
|
622
|
-
return this.
|
|
623
|
+
get onStepEnd() {
|
|
624
|
+
return this._onStepEnd;
|
|
623
625
|
}
|
|
624
626
|
get choiseIndex() {
|
|
625
627
|
return this._choiseIndex;
|
|
626
628
|
}
|
|
627
629
|
};
|
|
628
630
|
|
|
631
|
+
// src/classes/Label.ts
|
|
632
|
+
var Label = class extends LabelAbstract {
|
|
633
|
+
/**
|
|
634
|
+
* @param id is the id of the label
|
|
635
|
+
* @param steps is the list of steps that the label will perform
|
|
636
|
+
* @param props is the properties of the label
|
|
637
|
+
*/
|
|
638
|
+
constructor(id, steps, props) {
|
|
639
|
+
super(id, props);
|
|
640
|
+
this._steps = steps;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Get the steps of the label.
|
|
644
|
+
*/
|
|
645
|
+
get steps() {
|
|
646
|
+
if (typeof this._steps === "function") {
|
|
647
|
+
return this._steps();
|
|
648
|
+
}
|
|
649
|
+
return this._steps;
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
|
|
629
653
|
// src/classes/CloseLabel.ts
|
|
630
654
|
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
631
655
|
function newCloseLabel(choiseIndex) {
|
|
632
|
-
return new Label(CLOSE_LABEL_ID, [],
|
|
656
|
+
return new Label(CLOSE_LABEL_ID, [], {
|
|
657
|
+
choiseIndex
|
|
658
|
+
});
|
|
633
659
|
}
|
|
634
660
|
|
|
635
661
|
// src/types/CloseType.ts
|
|
636
662
|
var Close = "close";
|
|
637
663
|
|
|
664
|
+
// src/classes/ChoiceMenuOption.ts
|
|
665
|
+
var ChoiceMenuOption = class {
|
|
666
|
+
/**
|
|
667
|
+
* @param text Text to be displayed in the menu
|
|
668
|
+
* @param label Label to be opened when the option is selected or the id of the label
|
|
669
|
+
* @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.
|
|
670
|
+
* @param type Type of the label to be opened. @default "call"
|
|
671
|
+
*/
|
|
672
|
+
constructor(text, label, props, type = "call") {
|
|
673
|
+
/**
|
|
674
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
675
|
+
* @example
|
|
676
|
+
* ```tsx
|
|
677
|
+
* setChoiceMenuOptions([
|
|
678
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
679
|
+
* ])
|
|
680
|
+
* return <List>
|
|
681
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
682
|
+
* return (
|
|
683
|
+
* <ChoiceButton
|
|
684
|
+
* disabled={item.props.disabled}
|
|
685
|
+
* onClick={() => {
|
|
686
|
+
* afterSelectChoice(item)
|
|
687
|
+
* }}
|
|
688
|
+
* >
|
|
689
|
+
* {item.text}
|
|
690
|
+
* </ChoiceButton>
|
|
691
|
+
* )
|
|
692
|
+
* })}
|
|
693
|
+
* </List>
|
|
694
|
+
* ```
|
|
695
|
+
*/
|
|
696
|
+
this.props = {};
|
|
697
|
+
this.text = text;
|
|
698
|
+
this._label = label;
|
|
699
|
+
this.type = type;
|
|
700
|
+
if (props) {
|
|
701
|
+
this.props = props;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Label to be opened when the option is selected
|
|
706
|
+
*/
|
|
707
|
+
get label() {
|
|
708
|
+
let label = this._label;
|
|
709
|
+
if (typeof label === "string") {
|
|
710
|
+
let res = getLabelById(label);
|
|
711
|
+
if (res) {
|
|
712
|
+
label = res;
|
|
713
|
+
} else {
|
|
714
|
+
console.error(`Label ${label} not found, so it will be closed`);
|
|
715
|
+
label = newCloseLabel();
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
return label;
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
var ChoiceMenuOptionClose = class {
|
|
722
|
+
/**
|
|
723
|
+
* @param text Text to be displayed in the menu
|
|
724
|
+
* @param closeCurrentLabel If true, the current label will be closed. @default false
|
|
725
|
+
*/
|
|
726
|
+
constructor(text, closeCurrentLabel = false) {
|
|
727
|
+
/**
|
|
728
|
+
* Label to be opened when the option is selected
|
|
729
|
+
*/
|
|
730
|
+
this.label = newCloseLabel();
|
|
731
|
+
/**
|
|
732
|
+
* Type of the label to be opened
|
|
733
|
+
*/
|
|
734
|
+
this.type = Close;
|
|
735
|
+
/**
|
|
736
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
737
|
+
* @example
|
|
738
|
+
* ```tsx
|
|
739
|
+
* setChoiceMenuOptions([
|
|
740
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
741
|
+
* ])
|
|
742
|
+
* return <List>
|
|
743
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
744
|
+
* return (
|
|
745
|
+
* <ChoiceButton
|
|
746
|
+
* disabled={item.props.disabled}
|
|
747
|
+
* onClick={() => {
|
|
748
|
+
* afterSelectChoice(item)
|
|
749
|
+
* }}
|
|
750
|
+
* >
|
|
751
|
+
* {item.text}
|
|
752
|
+
* </ChoiceButton>
|
|
753
|
+
* )
|
|
754
|
+
* })}
|
|
755
|
+
* </List>
|
|
756
|
+
* ```
|
|
757
|
+
*/
|
|
758
|
+
this.props = {};
|
|
759
|
+
this.text = text;
|
|
760
|
+
this.closeCurrentLabel = closeCurrentLabel;
|
|
761
|
+
}
|
|
762
|
+
};
|
|
763
|
+
|
|
638
764
|
// src/functions/DialogueUtility.ts
|
|
639
765
|
function setDialogue(props) {
|
|
640
766
|
let text = "";
|
|
@@ -669,21 +795,18 @@ function getChoiceMenuOptions() {
|
|
|
669
795
|
d.forEach((option, index) => {
|
|
670
796
|
if (option.type === Close) {
|
|
671
797
|
let itemLabel = newCloseLabel(index);
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
type: Close,
|
|
676
|
-
closeCurrentLabel: option.closeCurrentLabel,
|
|
677
|
-
props: {}
|
|
678
|
-
});
|
|
798
|
+
let choice = new ChoiceMenuOptionClose(option.text, option.closeCurrentLabel);
|
|
799
|
+
choice.label = itemLabel;
|
|
800
|
+
options.push(choice);
|
|
679
801
|
return;
|
|
680
802
|
}
|
|
681
803
|
let label = getLabelById(option.label);
|
|
682
804
|
if (label) {
|
|
683
|
-
let itemLabel = new Label(label.id, label.steps,
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
})
|
|
805
|
+
let itemLabel = new Label(label.id, label.steps, {
|
|
806
|
+
onStepStart: label.onStepStart,
|
|
807
|
+
choiseIndex: index
|
|
808
|
+
});
|
|
809
|
+
options.push(new ChoiceMenuOption(option.text, itemLabel, option.props, option.type));
|
|
687
810
|
}
|
|
688
811
|
});
|
|
689
812
|
return options;
|
|
@@ -692,8 +815,9 @@ function getChoiceMenuOptions() {
|
|
|
692
815
|
}
|
|
693
816
|
|
|
694
817
|
// src/functions/TickerUtility.ts
|
|
695
|
-
function updateTickerProgression(args, propertyName, progression) {
|
|
696
|
-
|
|
818
|
+
function updateTickerProgression(args, propertyName, progression, valueConvert) {
|
|
819
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
820
|
+
if (args[propertyName] === void 0 || !progression || args[propertyName] === limit) {
|
|
697
821
|
return;
|
|
698
822
|
}
|
|
699
823
|
if (typeof args[propertyName] === "number") {
|
|
@@ -712,22 +836,25 @@ function updateTickerProgression(args, propertyName, progression) {
|
|
|
712
836
|
}
|
|
713
837
|
}
|
|
714
838
|
}
|
|
715
|
-
function getLinearProgression(number, progression) {
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
return
|
|
839
|
+
function getLinearProgression(number, progression, valueConvert) {
|
|
840
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
841
|
+
let amt = valueConvert ? valueConvert(progression.amt) : progression.amt;
|
|
842
|
+
if (limit !== void 0) {
|
|
843
|
+
if (number > limit && amt > 0) {
|
|
844
|
+
return limit;
|
|
845
|
+
} else if (number < limit && amt < 0) {
|
|
846
|
+
return limit;
|
|
721
847
|
}
|
|
722
848
|
}
|
|
723
|
-
return number +
|
|
849
|
+
return number + amt;
|
|
724
850
|
}
|
|
725
|
-
function getExponentialProgression(number, progression) {
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
851
|
+
function getExponentialProgression(number, progression, valueConvert) {
|
|
852
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
853
|
+
if (limit !== void 0) {
|
|
854
|
+
if (number > limit && progression.percentage > 0) {
|
|
855
|
+
return limit;
|
|
856
|
+
} else if (number < limit && progression.percentage < 0) {
|
|
857
|
+
return limit;
|
|
731
858
|
}
|
|
732
859
|
}
|
|
733
860
|
return number + number * progression.percentage;
|
|
@@ -770,15 +897,13 @@ var ZoomTicker = class extends TickerBase {
|
|
|
770
897
|
let ySpeed = 0.1;
|
|
771
898
|
if (args.speed) {
|
|
772
899
|
if (typeof args.speed === "number") {
|
|
773
|
-
xSpeed = args.speed;
|
|
774
|
-
ySpeed = args.speed;
|
|
900
|
+
xSpeed = this.speedConvert(args.speed);
|
|
901
|
+
ySpeed = this.speedConvert(args.speed);
|
|
775
902
|
} else {
|
|
776
|
-
xSpeed = args.speed.x;
|
|
777
|
-
ySpeed = args.speed.y;
|
|
903
|
+
xSpeed = this.speedConvert(args.speed.x);
|
|
904
|
+
ySpeed = this.speedConvert(args.speed.y);
|
|
778
905
|
}
|
|
779
906
|
}
|
|
780
|
-
xSpeed /= 60;
|
|
781
|
-
ySpeed /= 60;
|
|
782
907
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
783
908
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
784
909
|
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
@@ -845,7 +970,10 @@ var ZoomTicker = class extends TickerBase {
|
|
|
845
970
|
}
|
|
846
971
|
});
|
|
847
972
|
if (args.speedProgression)
|
|
848
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
973
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
974
|
+
}
|
|
975
|
+
speedConvert(speed) {
|
|
976
|
+
return speed / 60;
|
|
849
977
|
}
|
|
850
978
|
onEndOfTicker(tag, tickerId, _element, tagToRemoveAfter2) {
|
|
851
979
|
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
@@ -1840,6 +1968,16 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1840
1968
|
static set originalStepData(value) {
|
|
1841
1969
|
_GameStepManager._originalStepData = createExportableElement(value);
|
|
1842
1970
|
}
|
|
1971
|
+
static get currentStepData() {
|
|
1972
|
+
let currentStepData = {
|
|
1973
|
+
path: window.location.pathname,
|
|
1974
|
+
storage: GameStorageManager.export(),
|
|
1975
|
+
canvas: GameWindowManager.export(),
|
|
1976
|
+
labelIndex: _GameStepManager.currentLabelStepIndex || 0,
|
|
1977
|
+
openedLabels: createExportableElement(_GameStepManager._openedLabels)
|
|
1978
|
+
};
|
|
1979
|
+
return currentStepData;
|
|
1980
|
+
}
|
|
1843
1981
|
/* Edit History Methods */
|
|
1844
1982
|
/**
|
|
1845
1983
|
* Add a label to the history.
|
|
@@ -1847,19 +1985,13 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1847
1985
|
*/
|
|
1848
1986
|
static addStepHistory(step, choiseMade) {
|
|
1849
1987
|
let stepHistory = getStepSha1(step);
|
|
1850
|
-
let
|
|
1851
|
-
path: window.location.pathname,
|
|
1852
|
-
storage: GameStorageManager.export(),
|
|
1853
|
-
canvas: GameWindowManager.export(),
|
|
1854
|
-
labelIndex: _GameStepManager.currentLabelStepIndex || 0,
|
|
1855
|
-
openedLabels: createExportableElement(_GameStepManager._openedLabels)
|
|
1856
|
-
};
|
|
1988
|
+
let currentStepData = _GameStepManager.currentStepData;
|
|
1857
1989
|
if (_GameStepManager.originalStepData) {
|
|
1858
|
-
if (_GameStepManager.originalStepData.openedLabels.length ===
|
|
1990
|
+
if (_GameStepManager.originalStepData.openedLabels.length === currentStepData.openedLabels.length) {
|
|
1859
1991
|
try {
|
|
1860
1992
|
let lastStepDataOpenedLabelsString = JSON.stringify(_GameStepManager.originalStepData.openedLabels);
|
|
1861
|
-
let historyStepOpenedLabelsString = JSON.stringify(
|
|
1862
|
-
if (lastStepDataOpenedLabelsString === historyStepOpenedLabelsString && _GameStepManager.originalStepData.path ===
|
|
1993
|
+
let historyStepOpenedLabelsString = JSON.stringify(currentStepData.openedLabels);
|
|
1994
|
+
if (lastStepDataOpenedLabelsString === historyStepOpenedLabelsString && _GameStepManager.originalStepData.path === currentStepData.path && _GameStepManager.originalStepData.labelIndex === currentStepData.labelIndex) {
|
|
1863
1995
|
return;
|
|
1864
1996
|
}
|
|
1865
1997
|
} catch (e) {
|
|
@@ -1867,7 +1999,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1867
1999
|
}
|
|
1868
2000
|
}
|
|
1869
2001
|
}
|
|
1870
|
-
let data = deepDiff.diff(_GameStepManager.originalStepData,
|
|
2002
|
+
let data = deepDiff.diff(_GameStepManager.originalStepData, currentStepData);
|
|
1871
2003
|
if (data) {
|
|
1872
2004
|
let dialoge = void 0;
|
|
1873
2005
|
let requiredChoices = void 0;
|
|
@@ -1886,7 +2018,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1886
2018
|
index: _GameStepManager.lastStepIndex,
|
|
1887
2019
|
choiceIndexMade: choiseMade
|
|
1888
2020
|
});
|
|
1889
|
-
_GameStepManager.originalStepData =
|
|
2021
|
+
_GameStepManager.originalStepData = currentStepData;
|
|
1890
2022
|
}
|
|
1891
2023
|
_GameStepManager.increaseLastStepIndex();
|
|
1892
2024
|
}
|
|
@@ -1977,6 +2109,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1977
2109
|
console.warn("[Pixi'VN] The player must make a choice");
|
|
1978
2110
|
return;
|
|
1979
2111
|
}
|
|
2112
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2113
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2114
|
+
}
|
|
1980
2115
|
_GameStepManager.increaseCurrentStepIndex();
|
|
1981
2116
|
return yield _GameStepManager.runCurrentStep(props, choiseMade);
|
|
1982
2117
|
});
|
|
@@ -2001,6 +2136,10 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2001
2136
|
return;
|
|
2002
2137
|
}
|
|
2003
2138
|
if (currentLabel.steps.length > currentLabelStepIndex) {
|
|
2139
|
+
let onStepRun = currentLabel.onStepStart;
|
|
2140
|
+
if (onStepRun) {
|
|
2141
|
+
yield onStepRun(currentLabelStepIndex, currentLabel);
|
|
2142
|
+
}
|
|
2004
2143
|
let step = currentLabel.steps[currentLabelStepIndex];
|
|
2005
2144
|
let result = yield step(props);
|
|
2006
2145
|
_GameStepManager.addStepHistory(step, choiseMade);
|
|
@@ -2065,6 +2204,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2065
2204
|
if (!tempLabel) {
|
|
2066
2205
|
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
2067
2206
|
}
|
|
2207
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2208
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2209
|
+
}
|
|
2068
2210
|
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
2069
2211
|
} catch (e) {
|
|
2070
2212
|
console.error("[Pixi'VN] Error calling label", e);
|
|
@@ -2123,6 +2265,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2123
2265
|
if (!tempLabel) {
|
|
2124
2266
|
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
2125
2267
|
}
|
|
2268
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2269
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2270
|
+
}
|
|
2126
2271
|
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
2127
2272
|
} catch (e) {
|
|
2128
2273
|
console.error("[Pixi'VN] Error jumping label", e);
|
|
@@ -2228,24 +2373,29 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2228
2373
|
* ```
|
|
2229
2374
|
*/
|
|
2230
2375
|
static goBack(navigate, steps = 1) {
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2376
|
+
return __async(this, null, function* () {
|
|
2377
|
+
if (steps <= 0) {
|
|
2378
|
+
console.warn("[Pixi'VN] Steps must be greater than 0");
|
|
2379
|
+
return;
|
|
2380
|
+
}
|
|
2381
|
+
if (_GameStepManager._stepsHistory.length <= 1) {
|
|
2382
|
+
console.warn("[Pixi'VN] No steps to go back");
|
|
2383
|
+
return;
|
|
2384
|
+
}
|
|
2385
|
+
let restoredStep = _GameStepManager.goBackInternal(steps, _GameStepManager.originalStepData);
|
|
2386
|
+
if (restoredStep) {
|
|
2387
|
+
_GameStepManager._originalStepData = restoredStep;
|
|
2388
|
+
_GameStepManager._openedLabels = createExportableElement(restoredStep.openedLabels);
|
|
2389
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onLoadStep) {
|
|
2390
|
+
yield _GameStepManager.currentLabel.onLoadStep(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2391
|
+
}
|
|
2392
|
+
GameStorageManager.import(createExportableElement(restoredStep.storage));
|
|
2393
|
+
GameWindowManager.import(createExportableElement(restoredStep.canvas));
|
|
2394
|
+
navigate(restoredStep.path);
|
|
2395
|
+
} else {
|
|
2396
|
+
console.error("[Pixi'VN] Error going back");
|
|
2397
|
+
}
|
|
2398
|
+
});
|
|
2249
2399
|
}
|
|
2250
2400
|
static goBackInternal(steps, restoredStep) {
|
|
2251
2401
|
if (steps <= 0) {
|
|
@@ -2307,38 +2457,45 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2307
2457
|
* @param dataString The history in a JSON string.
|
|
2308
2458
|
*/
|
|
2309
2459
|
static importJson(dataString) {
|
|
2310
|
-
|
|
2460
|
+
return __async(this, null, function* () {
|
|
2461
|
+
yield _GameStepManager.import(JSON.parse(dataString));
|
|
2462
|
+
});
|
|
2311
2463
|
}
|
|
2312
2464
|
/**
|
|
2313
2465
|
* Import the history from an object.
|
|
2314
2466
|
* @param data The history in an object.
|
|
2315
2467
|
*/
|
|
2316
2468
|
static import(data) {
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2469
|
+
return __async(this, null, function* () {
|
|
2470
|
+
_GameStepManager.clear();
|
|
2471
|
+
try {
|
|
2472
|
+
if (data.hasOwnProperty("stepsHistory")) {
|
|
2473
|
+
_GameStepManager._stepsHistory = data["stepsHistory"];
|
|
2474
|
+
} else {
|
|
2475
|
+
console.warn("[Pixi'VN] Could not import stepsHistory data, so will be ignored");
|
|
2476
|
+
}
|
|
2477
|
+
if (data.hasOwnProperty("openedLabels")) {
|
|
2478
|
+
_GameStepManager._openedLabels = data["openedLabels"];
|
|
2479
|
+
} else {
|
|
2480
|
+
console.warn("[Pixi'VN] Could not import openedLabels data, so will be ignored");
|
|
2481
|
+
}
|
|
2482
|
+
if (data.hasOwnProperty("lastStepIndex")) {
|
|
2483
|
+
_GameStepManager._lastStepIndex = data["lastStepIndex"];
|
|
2484
|
+
} else {
|
|
2485
|
+
console.warn("[Pixi'VN] Could not import lastStepIndex data, so will be ignored");
|
|
2486
|
+
}
|
|
2487
|
+
if (data.hasOwnProperty("originalStepData")) {
|
|
2488
|
+
_GameStepManager._originalStepData = data["originalStepData"];
|
|
2489
|
+
} else {
|
|
2490
|
+
console.warn("[Pixi'VN] Could not import originalStepData data, so will be ignored");
|
|
2491
|
+
}
|
|
2492
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onLoadStep) {
|
|
2493
|
+
yield _GameStepManager.currentLabel.onLoadStep(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2494
|
+
}
|
|
2495
|
+
} catch (e) {
|
|
2496
|
+
console.error("[Pixi'VN] Error importing data", e);
|
|
2338
2497
|
}
|
|
2339
|
-
}
|
|
2340
|
-
console.error("[Pixi'VN] Error importing data", e);
|
|
2341
|
-
}
|
|
2498
|
+
});
|
|
2342
2499
|
}
|
|
2343
2500
|
};
|
|
2344
2501
|
/**
|
|
@@ -2512,11 +2669,11 @@ var DialogueBaseModel = class {
|
|
|
2512
2669
|
|
|
2513
2670
|
// src/decorators/LabelDecorator.ts
|
|
2514
2671
|
var registeredLabels = {};
|
|
2515
|
-
function newLabel(id, steps,
|
|
2672
|
+
function newLabel(id, steps, props) {
|
|
2516
2673
|
if (registeredLabels[id]) {
|
|
2517
2674
|
console.info(`[Pixi'VN] Label ${id} already exists, it will be overwritten`);
|
|
2518
2675
|
}
|
|
2519
|
-
let label = new Label(id, steps,
|
|
2676
|
+
let label = new Label(id, steps, props);
|
|
2520
2677
|
registeredLabels[id] = label;
|
|
2521
2678
|
return label;
|
|
2522
2679
|
}
|
|
@@ -2583,15 +2740,13 @@ var MoveTicker = class extends TickerBase {
|
|
|
2583
2740
|
let ySpeed = 1;
|
|
2584
2741
|
if (args.speed) {
|
|
2585
2742
|
if (typeof args.speed === "number") {
|
|
2586
|
-
xSpeed = args.speed;
|
|
2587
|
-
ySpeed = args.speed;
|
|
2743
|
+
xSpeed = this.speedConvert(args.speed);
|
|
2744
|
+
ySpeed = this.speedConvert(args.speed);
|
|
2588
2745
|
} else {
|
|
2589
|
-
xSpeed = args.speed.x;
|
|
2590
|
-
ySpeed = args.speed.y;
|
|
2746
|
+
xSpeed = this.speedConvert(args.speed.x);
|
|
2747
|
+
ySpeed = this.speedConvert(args.speed.y);
|
|
2591
2748
|
}
|
|
2592
2749
|
}
|
|
2593
|
-
xSpeed /= 60;
|
|
2594
|
-
ySpeed /= 60;
|
|
2595
2750
|
let destination = args.destination;
|
|
2596
2751
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
2597
2752
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
@@ -2631,7 +2786,10 @@ var MoveTicker = class extends TickerBase {
|
|
|
2631
2786
|
}
|
|
2632
2787
|
});
|
|
2633
2788
|
if (args.speedProgression)
|
|
2634
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
2789
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
2790
|
+
}
|
|
2791
|
+
speedConvert(speed) {
|
|
2792
|
+
return speed / 6;
|
|
2635
2793
|
}
|
|
2636
2794
|
};
|
|
2637
2795
|
MoveTicker = __decorateClass([
|
|
@@ -2639,7 +2797,7 @@ MoveTicker = __decorateClass([
|
|
|
2639
2797
|
], MoveTicker);
|
|
2640
2798
|
var RotateTicker = class extends TickerBase {
|
|
2641
2799
|
fn(ticker, args, tags, tickerId) {
|
|
2642
|
-
let speed = (args.speed === void 0 ? 1 : args.speed)
|
|
2800
|
+
let speed = this.speedConvert(args.speed === void 0 ? 1 : args.speed);
|
|
2643
2801
|
let clockwise = args.clockwise === void 0 ? true : args.clockwise;
|
|
2644
2802
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
2645
2803
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
@@ -2667,7 +2825,10 @@ var RotateTicker = class extends TickerBase {
|
|
|
2667
2825
|
}
|
|
2668
2826
|
});
|
|
2669
2827
|
if (args.speedProgression)
|
|
2670
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
2828
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
2829
|
+
}
|
|
2830
|
+
speedConvert(speed) {
|
|
2831
|
+
return speed / 60;
|
|
2671
2832
|
}
|
|
2672
2833
|
};
|
|
2673
2834
|
RotateTicker = __decorateClass([
|
|
@@ -2678,7 +2839,7 @@ RotateTicker = __decorateClass([
|
|
|
2678
2839
|
var juliette = new CharacterBaseModel2("___pixivn_juliette___", {
|
|
2679
2840
|
name: "Juliette",
|
|
2680
2841
|
age: 25,
|
|
2681
|
-
icon: "https://firebasestorage.googleapis.com/v0/b/pixi-vn.appspot.com/o/public%2Fcharacters%2Fjuliette-square.webp?alt=media
|
|
2842
|
+
icon: "https://firebasestorage.googleapis.com/v0/b/pixi-vn.appspot.com/o/public%2Fcharacters%2Fjuliette-square.webp?alt=media",
|
|
2682
2843
|
color: "#ac0086"
|
|
2683
2844
|
});
|
|
2684
2845
|
saveCharacter(juliette);
|
|
@@ -2714,10 +2875,16 @@ var baseCanvasElementTestLabel = newLabel(
|
|
|
2714
2875
|
removeCanvasElement("container");
|
|
2715
2876
|
setDialogue({
|
|
2716
2877
|
character: juliette,
|
|
2717
|
-
text: `Here's what's going to happen: I'm going to create some
|
|
2878
|
+
text: `Here's what's going to happen: I'm going to create some CanvasText with different styles and put them on the stage.
|
|
2718
2879
|
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)).`
|
|
2719
2880
|
});
|
|
2720
|
-
const
|
|
2881
|
+
const basicStyle = new pixi_js.TextStyle({
|
|
2882
|
+
fill: "#ffffff"
|
|
2883
|
+
});
|
|
2884
|
+
const basicText = new CanvasText({
|
|
2885
|
+
text: "Basic text in pixi",
|
|
2886
|
+
style: basicStyle
|
|
2887
|
+
});
|
|
2721
2888
|
basicText.x = 50;
|
|
2722
2889
|
basicText.y = 100;
|
|
2723
2890
|
GameWindowManager.addCanvasElement("basicText", basicText);
|
|
@@ -2735,7 +2902,7 @@ But it will generate a warn message, because the FillGradient or FillPattern has
|
|
|
2735
2902
|
fill: { fill },
|
|
2736
2903
|
stroke: { color: "#4a1850", width: 5, join: "round" },
|
|
2737
2904
|
dropShadow: {
|
|
2738
|
-
color: "#
|
|
2905
|
+
color: "#ff5f74",
|
|
2739
2906
|
blur: 4,
|
|
2740
2907
|
angle: Math.PI / 6,
|
|
2741
2908
|
distance: 6
|