@drincs/pixi-vn 0.6.5 → 0.6.7
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 +49 -3
- package/dist/classes/CharacterBaseModel.js +57 -57
- package/dist/classes/CharacterBaseModel.js.map +1 -1
- package/dist/classes/CharacterBaseModel.mjs +57 -57
- package/dist/classes/CharacterBaseModel.mjs.map +1 -1
- package/dist/classes/ChoiceMenuOption.d.mts +5 -2
- package/dist/classes/ChoiceMenuOption.d.ts +5 -2
- package/dist/classes/ChoiceMenuOption.js +42 -25
- package/dist/classes/ChoiceMenuOption.js.map +1 -1
- package/dist/classes/ChoiceMenuOption.mjs +42 -25
- 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 +25 -16
- package/dist/classes/CloseLabel.js.map +1 -1
- package/dist/classes/CloseLabel.mjs +25 -16
- package/dist/classes/CloseLabel.mjs.map +1 -1
- package/dist/classes/Label.d.mts +45 -4
- package/dist/classes/Label.d.ts +45 -4
- package/dist/classes/Label.js +25 -16
- package/dist/classes/Label.js.map +1 -1
- package/dist/classes/Label.mjs +25 -16
- 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.map +1 -1
- package/dist/classes/StoredClassModel.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 +827 -26
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +827 -27
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.mjs.map +1 -1
- package/dist/classes/ticker/MoveTicker.js.map +1 -1
- package/dist/classes/ticker/MoveTicker.mjs.map +1 -1
- package/dist/classes/ticker/RotateTicker.js.map +1 -1
- package/dist/classes/ticker/RotateTicker.mjs.map +1 -1
- package/dist/classes/ticker/ZoomTicker.js.map +1 -1
- package/dist/classes/ticker/ZoomTicker.mjs.map +1 -1
- package/dist/classes/ticker/index.js.map +1 -1
- 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/LabelDecorator.d.mts +19 -5
- package/dist/decorators/LabelDecorator.d.ts +19 -5
- package/dist/decorators/LabelDecorator.js +29 -16
- package/dist/decorators/LabelDecorator.js.map +1 -1
- package/dist/decorators/LabelDecorator.mjs +29 -17
- 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 +25 -16
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +25 -16
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/DialogueUtility.d.mts +3 -1
- package/dist/functions/DialogueUtility.d.ts +3 -1
- package/dist/functions/DialogueUtility.js +85 -26
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +85 -26
- package/dist/functions/DialogueUtility.mjs.map +1 -1
- package/dist/functions/FlagsUtility.js.map +1 -1
- package/dist/functions/FlagsUtility.mjs.map +1 -1
- package/dist/functions/GameUtility.js.map +1 -1
- package/dist/functions/GameUtility.mjs.map +1 -1
- package/dist/functions/ImageUtility.js.map +1 -1
- 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 +3 -1
- package/dist/functions/SavesUtility.d.ts +3 -1
- package/dist/functions/SavesUtility.js +139 -36
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +139 -36
- package/dist/functions/SavesUtility.mjs.map +1 -1
- package/dist/functions/index.d.mts +6 -1
- package/dist/functions/index.d.ts +6 -1
- package/dist/functions/index.js +169 -27
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +169 -28
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +131 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +130 -37
- 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 -5
- package/dist/interface/LabelProps.d.ts +38 -5
- 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 +6 -4
- package/dist/interface/index.d.ts +6 -4
- package/dist/labels/BaseCanvasElementTestLabel.d.mts +3 -1
- package/dist/labels/BaseCanvasElementTestLabel.d.ts +3 -1
- package/dist/labels/BaseCanvasElementTestLabel.js +129 -26
- package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/BaseCanvasElementTestLabel.mjs +130 -27
- package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -1
- package/dist/labels/CanvasEventsTestLabel.d.mts +3 -1
- package/dist/labels/CanvasEventsTestLabel.d.ts +3 -1
- package/dist/labels/CanvasEventsTestLabel.js +129 -26
- package/dist/labels/CanvasEventsTestLabel.js.map +1 -1
- package/dist/labels/CanvasEventsTestLabel.mjs +129 -26
- 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 +129 -26
- package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs +130 -27
- 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 +46 -35
- package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -1
- package/dist/labels/ImagesAnimationsTestLabel.mjs +47 -36
- 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 +129 -26
- package/dist/labels/MarkdownTest.js.map +1 -1
- package/dist/labels/MarkdownTest.mjs +129 -26
- 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 +47 -36
- package/dist/labels/StartLabel.js.map +1 -1
- package/dist/labels/StartLabel.mjs +47 -36
- package/dist/labels/StartLabel.mjs.map +1 -1
- package/dist/labels/StepLabelTest.d.mts +3 -1
- package/dist/labels/StepLabelTest.d.ts +3 -1
- package/dist/labels/StepLabelTest.js +129 -26
- package/dist/labels/StepLabelTest.js.map +1 -1
- package/dist/labels/StepLabelTest.mjs +129 -26
- package/dist/labels/StepLabelTest.mjs.map +1 -1
- package/dist/labels/TestConstant.js.map +1 -1
- 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 +47 -36
- package/dist/labels/index.js.map +1 -1
- package/dist/labels/index.mjs +47 -36
- package/dist/labels/index.mjs.map +1 -1
- package/dist/managers/StepManager.d.mts +5 -3
- package/dist/managers/StepManager.d.ts +5 -3
- package/dist/managers/StepManager.js +138 -35
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +138 -35
- package/dist/managers/StepManager.mjs.map +1 -1
- package/dist/managers/WindowManager.js.map +1 -1
- 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 +138 -35
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +138 -35
- 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 +5 -1
- package/dist/types/index.d.ts +5 -1
- package/package.json +3 -2
- package/dist/LabelProps-CFV-zRjG.d.ts +0 -113
- package/dist/LabelProps-CmRpvUJm.d.mts +0 -113
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Ticker } from 'pixi.js';
|
|
2
|
-
import
|
|
2
|
+
import Label from '../classes/Label.mjs';
|
|
3
3
|
import { T as TickerBase } from '../TickerBase-DKYzbzro.mjs';
|
|
4
4
|
import '../types/LabelIdType.mjs';
|
|
5
5
|
import '../types/StepLabelType.mjs';
|
|
6
6
|
import '@drincs/pixi-vn/dist/override';
|
|
7
|
+
import '../classes/LabelAbstract.mjs';
|
|
7
8
|
import '../types/StepHistoryDataType.mjs';
|
|
9
|
+
import '../interface/LabelProps.mjs';
|
|
8
10
|
import '../types/StorageElementType.mjs';
|
|
9
11
|
import '../types/TickerIdType.mjs';
|
|
10
12
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Ticker } from 'pixi.js';
|
|
2
|
-
import
|
|
2
|
+
import Label from '../classes/Label.js';
|
|
3
3
|
import { T as TickerBase } from '../TickerBase-3rLpDpmb.js';
|
|
4
4
|
import '../types/LabelIdType.js';
|
|
5
5
|
import '../types/StepLabelType.js';
|
|
6
6
|
import '@drincs/pixi-vn/dist/override';
|
|
7
|
+
import '../classes/LabelAbstract.js';
|
|
7
8
|
import '../types/StepHistoryDataType.js';
|
|
9
|
+
import '../interface/LabelProps.js';
|
|
8
10
|
import '../types/StorageElementType.js';
|
|
9
11
|
import '../types/TickerIdType.js';
|
|
10
12
|
|
|
@@ -568,16 +568,14 @@ function checkIfStepsIsEqual(step1, step2) {
|
|
|
568
568
|
return step1 === step2;
|
|
569
569
|
}
|
|
570
570
|
|
|
571
|
-
// src/classes/
|
|
572
|
-
var
|
|
571
|
+
// src/classes/LabelAbstract.ts
|
|
572
|
+
var LabelAbstract = class {
|
|
573
573
|
/**
|
|
574
574
|
* @param id is the id of the label
|
|
575
|
-
* @param steps is the list of steps that the label will perform
|
|
576
575
|
* @param props is the properties of the label
|
|
577
576
|
*/
|
|
578
|
-
constructor(id,
|
|
577
|
+
constructor(id, props) {
|
|
579
578
|
this._id = id;
|
|
580
|
-
this._steps = steps;
|
|
581
579
|
this._onStepStart = props == null ? void 0 : props.onStepStart;
|
|
582
580
|
this._onLoadStep = props == null ? void 0 : props.onLoadStep;
|
|
583
581
|
this._onStepEnd = props == null ? void 0 : props.onStepEnd;
|
|
@@ -589,17 +587,6 @@ var Label = class {
|
|
|
589
587
|
get id() {
|
|
590
588
|
return this._id;
|
|
591
589
|
}
|
|
592
|
-
/**
|
|
593
|
-
* Get the steps of the label.
|
|
594
|
-
* This class should be extended and the steps method should be overridden.
|
|
595
|
-
* Every time you update this list will also be updated when the other game versions load.
|
|
596
|
-
*/
|
|
597
|
-
get steps() {
|
|
598
|
-
if (typeof this._steps === "function") {
|
|
599
|
-
return this._steps();
|
|
600
|
-
}
|
|
601
|
-
return this._steps;
|
|
602
|
-
}
|
|
603
590
|
/**
|
|
604
591
|
* Get the corresponding steps number
|
|
605
592
|
* @param externalSteps
|
|
@@ -650,6 +637,28 @@ var Label = class {
|
|
|
650
637
|
}
|
|
651
638
|
};
|
|
652
639
|
|
|
640
|
+
// src/classes/Label.ts
|
|
641
|
+
var Label = class extends LabelAbstract {
|
|
642
|
+
/**
|
|
643
|
+
* @param id is the id of the label
|
|
644
|
+
* @param steps is the list of steps that the label will perform
|
|
645
|
+
* @param props is the properties of the label
|
|
646
|
+
*/
|
|
647
|
+
constructor(id, steps, props) {
|
|
648
|
+
super(id, props);
|
|
649
|
+
this._steps = steps;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Get the steps of the label.
|
|
653
|
+
*/
|
|
654
|
+
get steps() {
|
|
655
|
+
if (typeof this._steps === "function") {
|
|
656
|
+
return this._steps();
|
|
657
|
+
}
|
|
658
|
+
return this._steps;
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
|
|
653
662
|
// src/classes/CloseLabel.ts
|
|
654
663
|
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
655
664
|
function newCloseLabel(choiseIndex) {
|
|
@@ -661,6 +670,106 @@ function newCloseLabel(choiseIndex) {
|
|
|
661
670
|
// src/types/CloseType.ts
|
|
662
671
|
var Close = "close";
|
|
663
672
|
|
|
673
|
+
// src/classes/ChoiceMenuOption.ts
|
|
674
|
+
var ChoiceMenuOption = class {
|
|
675
|
+
/**
|
|
676
|
+
* @param text Text to be displayed in the menu
|
|
677
|
+
* @param label Label to be opened when the option is selected or the id of the label
|
|
678
|
+
* @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.
|
|
679
|
+
* @param type Type of the label to be opened. @default "call"
|
|
680
|
+
*/
|
|
681
|
+
constructor(text, label, props, type = "call") {
|
|
682
|
+
/**
|
|
683
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
684
|
+
* @example
|
|
685
|
+
* ```tsx
|
|
686
|
+
* setChoiceMenuOptions([
|
|
687
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
688
|
+
* ])
|
|
689
|
+
* return <List>
|
|
690
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
691
|
+
* return (
|
|
692
|
+
* <ChoiceButton
|
|
693
|
+
* disabled={item.props.disabled}
|
|
694
|
+
* onClick={() => {
|
|
695
|
+
* afterSelectChoice(item)
|
|
696
|
+
* }}
|
|
697
|
+
* >
|
|
698
|
+
* {item.text}
|
|
699
|
+
* </ChoiceButton>
|
|
700
|
+
* )
|
|
701
|
+
* })}
|
|
702
|
+
* </List>
|
|
703
|
+
* ```
|
|
704
|
+
*/
|
|
705
|
+
this.props = {};
|
|
706
|
+
this.text = text;
|
|
707
|
+
this._label = label;
|
|
708
|
+
this.type = type;
|
|
709
|
+
if (props) {
|
|
710
|
+
this.props = props;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Label to be opened when the option is selected
|
|
715
|
+
*/
|
|
716
|
+
get label() {
|
|
717
|
+
let label = this._label;
|
|
718
|
+
if (typeof label === "string") {
|
|
719
|
+
let res = getLabelById(label);
|
|
720
|
+
if (res) {
|
|
721
|
+
label = res;
|
|
722
|
+
} else {
|
|
723
|
+
console.error(`Label ${label} not found, so it will be closed`);
|
|
724
|
+
label = newCloseLabel();
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
return label;
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
var ChoiceMenuOptionClose = class {
|
|
731
|
+
/**
|
|
732
|
+
* @param text Text to be displayed in the menu
|
|
733
|
+
* @param closeCurrentLabel If true, the current label will be closed. @default false
|
|
734
|
+
*/
|
|
735
|
+
constructor(text, closeCurrentLabel = false) {
|
|
736
|
+
/**
|
|
737
|
+
* Label to be opened when the option is selected
|
|
738
|
+
*/
|
|
739
|
+
this.label = newCloseLabel();
|
|
740
|
+
/**
|
|
741
|
+
* Type of the label to be opened
|
|
742
|
+
*/
|
|
743
|
+
this.type = Close;
|
|
744
|
+
/**
|
|
745
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
746
|
+
* @example
|
|
747
|
+
* ```tsx
|
|
748
|
+
* setChoiceMenuOptions([
|
|
749
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
750
|
+
* ])
|
|
751
|
+
* return <List>
|
|
752
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
753
|
+
* return (
|
|
754
|
+
* <ChoiceButton
|
|
755
|
+
* disabled={item.props.disabled}
|
|
756
|
+
* onClick={() => {
|
|
757
|
+
* afterSelectChoice(item)
|
|
758
|
+
* }}
|
|
759
|
+
* >
|
|
760
|
+
* {item.text}
|
|
761
|
+
* </ChoiceButton>
|
|
762
|
+
* )
|
|
763
|
+
* })}
|
|
764
|
+
* </List>
|
|
765
|
+
* ```
|
|
766
|
+
*/
|
|
767
|
+
this.props = {};
|
|
768
|
+
this.text = text;
|
|
769
|
+
this.closeCurrentLabel = closeCurrentLabel;
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
|
|
664
773
|
// src/functions/DialogueUtility.ts
|
|
665
774
|
function setDialogue(props) {
|
|
666
775
|
let text = "";
|
|
@@ -695,13 +804,9 @@ function getChoiceMenuOptions() {
|
|
|
695
804
|
d.forEach((option, index) => {
|
|
696
805
|
if (option.type === Close) {
|
|
697
806
|
let itemLabel = newCloseLabel(index);
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
type: Close,
|
|
702
|
-
closeCurrentLabel: option.closeCurrentLabel,
|
|
703
|
-
props: {}
|
|
704
|
-
});
|
|
807
|
+
let choice = new ChoiceMenuOptionClose(option.text, option.closeCurrentLabel);
|
|
808
|
+
choice.label = itemLabel;
|
|
809
|
+
options.push(choice);
|
|
705
810
|
return;
|
|
706
811
|
}
|
|
707
812
|
let label = getLabelById(option.label);
|
|
@@ -710,9 +815,7 @@ function getChoiceMenuOptions() {
|
|
|
710
815
|
onStepStart: label.onStepStart,
|
|
711
816
|
choiseIndex: index
|
|
712
817
|
});
|
|
713
|
-
options.push(
|
|
714
|
-
label: itemLabel
|
|
715
|
-
}));
|
|
818
|
+
options.push(new ChoiceMenuOption(option.text, itemLabel, option.props, option.type));
|
|
716
819
|
}
|
|
717
820
|
});
|
|
718
821
|
return options;
|