@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
|
@@ -7,9 +7,11 @@ import DialogueBaseModel from '../classes/DialogueBaseModel.mjs';
|
|
|
7
7
|
import { LabelIdType } from '../types/LabelIdType.mjs';
|
|
8
8
|
import { StepHistoryDataType } from '../types/StepHistoryDataType.mjs';
|
|
9
9
|
import '../types/StorageElementType.mjs';
|
|
10
|
-
import '../
|
|
10
|
+
import '../classes/Label.mjs';
|
|
11
11
|
import '../types/StepLabelType.mjs';
|
|
12
12
|
import '@drincs/pixi-vn/dist/override';
|
|
13
|
+
import '../classes/LabelAbstract.mjs';
|
|
14
|
+
import './LabelProps.mjs';
|
|
13
15
|
import '../types/CloseType.mjs';
|
|
14
16
|
import '../types/LabelRunModeType.mjs';
|
|
15
17
|
import './canvas/ICanvasBaseMemory.mjs';
|
|
@@ -7,9 +7,11 @@ import DialogueBaseModel from '../classes/DialogueBaseModel.js';
|
|
|
7
7
|
import { LabelIdType } from '../types/LabelIdType.js';
|
|
8
8
|
import { StepHistoryDataType } from '../types/StepHistoryDataType.js';
|
|
9
9
|
import '../types/StorageElementType.js';
|
|
10
|
-
import '../
|
|
10
|
+
import '../classes/Label.js';
|
|
11
11
|
import '../types/StepLabelType.js';
|
|
12
12
|
import '@drincs/pixi-vn/dist/override';
|
|
13
|
+
import '../classes/LabelAbstract.js';
|
|
14
|
+
import './LabelProps.js';
|
|
13
15
|
import '../types/CloseType.js';
|
|
14
16
|
import '../types/LabelRunModeType.js';
|
|
15
17
|
import './canvas/ICanvasBaseMemory.js';
|
|
@@ -14,10 +14,12 @@ import './IHistoryStep.mjs';
|
|
|
14
14
|
import 'deep-diff';
|
|
15
15
|
import '../classes/ChoiceMenuOption.mjs';
|
|
16
16
|
import '../types/LabelIdType.mjs';
|
|
17
|
-
import '../
|
|
17
|
+
import '../classes/Label.mjs';
|
|
18
18
|
import '../types/StepLabelType.mjs';
|
|
19
19
|
import '@drincs/pixi-vn/dist/override';
|
|
20
|
+
import '../classes/LabelAbstract.mjs';
|
|
20
21
|
import '../types/StepHistoryDataType.mjs';
|
|
22
|
+
import './LabelProps.mjs';
|
|
21
23
|
import '../types/CloseType.mjs';
|
|
22
24
|
import '../types/LabelRunModeType.mjs';
|
|
23
25
|
import './IOpenedLabel.mjs';
|
|
@@ -14,10 +14,12 @@ import './IHistoryStep.js';
|
|
|
14
14
|
import 'deep-diff';
|
|
15
15
|
import '../classes/ChoiceMenuOption.js';
|
|
16
16
|
import '../types/LabelIdType.js';
|
|
17
|
-
import '../
|
|
17
|
+
import '../classes/Label.js';
|
|
18
18
|
import '../types/StepLabelType.js';
|
|
19
19
|
import '@drincs/pixi-vn/dist/override';
|
|
20
|
+
import '../classes/LabelAbstract.js';
|
|
20
21
|
import '../types/StepHistoryDataType.js';
|
|
22
|
+
import './LabelProps.js';
|
|
21
23
|
import '../types/CloseType.js';
|
|
22
24
|
import '../types/LabelRunModeType.js';
|
|
23
25
|
import './IOpenedLabel.js';
|
|
@@ -1,5 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
interface LabelProps<T> {
|
|
2
|
+
/**
|
|
3
|
+
* 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.
|
|
4
|
+
* @param stepIndex Step index
|
|
5
|
+
* @param label Label
|
|
6
|
+
* @returns
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* newLabel("id", [], {
|
|
10
|
+
* onStepStart: async (stepIndex, label) => {
|
|
11
|
+
* await Assets.load('path/to/image1.png')
|
|
12
|
+
* await Assets.load('path/to/image2.png')
|
|
13
|
+
* }
|
|
14
|
+
* })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
onStepStart?: (stepIndex: number, label: T) => void | Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* 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.
|
|
20
|
+
* @param stepIndex Step index
|
|
21
|
+
* @param label Label
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
onLoadStep?: (stepIndex: number, label: T) => void | Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Is a function that will be executed when the step ends.
|
|
27
|
+
* @param stepIndex Step index
|
|
28
|
+
* @param label Label
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
onStepEnd?: (stepIndex: number, label: T) => void | Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Is the index of the choice that the label will perform. This variable is used in the system.
|
|
34
|
+
*/
|
|
35
|
+
choiseIndex?: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type { LabelProps as default };
|
|
@@ -1,5 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
interface LabelProps<T> {
|
|
2
|
+
/**
|
|
3
|
+
* 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.
|
|
4
|
+
* @param stepIndex Step index
|
|
5
|
+
* @param label Label
|
|
6
|
+
* @returns
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* newLabel("id", [], {
|
|
10
|
+
* onStepStart: async (stepIndex, label) => {
|
|
11
|
+
* await Assets.load('path/to/image1.png')
|
|
12
|
+
* await Assets.load('path/to/image2.png')
|
|
13
|
+
* }
|
|
14
|
+
* })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
onStepStart?: (stepIndex: number, label: T) => void | Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* 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.
|
|
20
|
+
* @param stepIndex Step index
|
|
21
|
+
* @param label Label
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
onLoadStep?: (stepIndex: number, label: T) => void | Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Is a function that will be executed when the step ends.
|
|
27
|
+
* @param stepIndex Step index
|
|
28
|
+
* @param label Label
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
onStepEnd?: (stepIndex: number, label: T) => void | Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Is the index of the choice that the label will perform. This variable is used in the system.
|
|
34
|
+
*/
|
|
35
|
+
choiseIndex?: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type { LabelProps as default };
|
|
@@ -14,10 +14,12 @@ import '../TickerHistory.mjs';
|
|
|
14
14
|
import 'deep-diff';
|
|
15
15
|
import '../../classes/ChoiceMenuOption.mjs';
|
|
16
16
|
import '../../types/LabelIdType.mjs';
|
|
17
|
-
import '../../
|
|
17
|
+
import '../../classes/Label.mjs';
|
|
18
18
|
import '../../types/StepLabelType.mjs';
|
|
19
19
|
import '@drincs/pixi-vn/dist/override';
|
|
20
|
+
import '../../classes/LabelAbstract.mjs';
|
|
20
21
|
import '../../types/StepHistoryDataType.mjs';
|
|
22
|
+
import '../LabelProps.mjs';
|
|
21
23
|
import '../../types/CloseType.mjs';
|
|
22
24
|
import '../../types/LabelRunModeType.mjs';
|
|
23
25
|
import '../../classes/DialogueBaseModel.mjs';
|
|
@@ -14,10 +14,12 @@ import '../TickerHistory.js';
|
|
|
14
14
|
import 'deep-diff';
|
|
15
15
|
import '../../classes/ChoiceMenuOption.js';
|
|
16
16
|
import '../../types/LabelIdType.js';
|
|
17
|
-
import '../../
|
|
17
|
+
import '../../classes/Label.js';
|
|
18
18
|
import '../../types/StepLabelType.js';
|
|
19
19
|
import '@drincs/pixi-vn/dist/override';
|
|
20
|
+
import '../../classes/LabelAbstract.js';
|
|
20
21
|
import '../../types/StepHistoryDataType.js';
|
|
22
|
+
import '../LabelProps.js';
|
|
21
23
|
import '../../types/CloseType.js';
|
|
22
24
|
import '../../types/LabelRunModeType.js';
|
|
23
25
|
import '../../classes/DialogueBaseModel.js';
|
|
@@ -14,10 +14,12 @@ import '../IHistoryStep.mjs';
|
|
|
14
14
|
import 'deep-diff';
|
|
15
15
|
import '../../classes/ChoiceMenuOption.mjs';
|
|
16
16
|
import '../../types/LabelIdType.mjs';
|
|
17
|
-
import '../../
|
|
17
|
+
import '../../classes/Label.mjs';
|
|
18
18
|
import '../../types/StepLabelType.mjs';
|
|
19
19
|
import '@drincs/pixi-vn/dist/override';
|
|
20
|
+
import '../../classes/LabelAbstract.mjs';
|
|
20
21
|
import '../../types/StepHistoryDataType.mjs';
|
|
22
|
+
import '../LabelProps.mjs';
|
|
21
23
|
import '../../types/CloseType.mjs';
|
|
22
24
|
import '../../types/LabelRunModeType.mjs';
|
|
23
25
|
import '../IOpenedLabel.mjs';
|
|
@@ -14,10 +14,12 @@ import '../IHistoryStep.js';
|
|
|
14
14
|
import 'deep-diff';
|
|
15
15
|
import '../../classes/ChoiceMenuOption.js';
|
|
16
16
|
import '../../types/LabelIdType.js';
|
|
17
|
-
import '../../
|
|
17
|
+
import '../../classes/Label.js';
|
|
18
18
|
import '../../types/StepLabelType.js';
|
|
19
19
|
import '@drincs/pixi-vn/dist/override';
|
|
20
|
+
import '../../classes/LabelAbstract.js';
|
|
20
21
|
import '../../types/StepHistoryDataType.js';
|
|
22
|
+
import '../LabelProps.js';
|
|
21
23
|
import '../../types/CloseType.js';
|
|
22
24
|
import '../../types/LabelRunModeType.js';
|
|
23
25
|
import '../IOpenedLabel.js';
|
|
@@ -5,7 +5,7 @@ export { default as IOpenedLabel } from './IOpenedLabel.mjs';
|
|
|
5
5
|
export { default as ISaveData } from './ISaveData.mjs';
|
|
6
6
|
export { I as ITicker } from '../TickerBase-DKYzbzro.mjs';
|
|
7
7
|
export { default as ITickersSteps } from './ITickersSteps.mjs';
|
|
8
|
-
export {
|
|
8
|
+
export { default as LabelProps } from './LabelProps.mjs';
|
|
9
9
|
export { default as TickerHistory, TickerHistoryForExport } from './TickerHistory.mjs';
|
|
10
10
|
export { TickerProgrationType } from './TickerProgrationType.mjs';
|
|
11
11
|
export { default as TickerTimeoutHistory } from './TickerTimeoutHistory.mjs';
|
|
@@ -19,14 +19,16 @@ import '../types/StorageElementType.mjs';
|
|
|
19
19
|
import 'deep-diff';
|
|
20
20
|
import '../classes/ChoiceMenuOption.mjs';
|
|
21
21
|
import '../types/LabelIdType.mjs';
|
|
22
|
+
import '../classes/Label.mjs';
|
|
23
|
+
import '../types/StepLabelType.mjs';
|
|
24
|
+
import '@drincs/pixi-vn/dist/override';
|
|
25
|
+
import '../classes/LabelAbstract.mjs';
|
|
26
|
+
import '../types/StepHistoryDataType.mjs';
|
|
22
27
|
import './export/ExportedCanvas.mjs';
|
|
23
28
|
import './canvas/ICanvasBaseMemory.mjs';
|
|
24
29
|
import './export/ExportedStorage.mjs';
|
|
25
|
-
import '../types/StepHistoryDataType.mjs';
|
|
26
30
|
import './export/ExportedStep.mjs';
|
|
27
31
|
import 'pixi.js';
|
|
28
32
|
import '../types/TickerIdType.mjs';
|
|
29
33
|
import '../types/PauseType.mjs';
|
|
30
34
|
import '../types/RepeatType.mjs';
|
|
31
|
-
import '../types/StepLabelType.mjs';
|
|
32
|
-
import '@drincs/pixi-vn/dist/override';
|
|
@@ -5,7 +5,7 @@ export { default as IOpenedLabel } from './IOpenedLabel.js';
|
|
|
5
5
|
export { default as ISaveData } from './ISaveData.js';
|
|
6
6
|
export { I as ITicker } from '../TickerBase-3rLpDpmb.js';
|
|
7
7
|
export { default as ITickersSteps } from './ITickersSteps.js';
|
|
8
|
-
export {
|
|
8
|
+
export { default as LabelProps } from './LabelProps.js';
|
|
9
9
|
export { default as TickerHistory, TickerHistoryForExport } from './TickerHistory.js';
|
|
10
10
|
export { TickerProgrationType } from './TickerProgrationType.js';
|
|
11
11
|
export { default as TickerTimeoutHistory } from './TickerTimeoutHistory.js';
|
|
@@ -19,14 +19,16 @@ import '../types/StorageElementType.js';
|
|
|
19
19
|
import 'deep-diff';
|
|
20
20
|
import '../classes/ChoiceMenuOption.js';
|
|
21
21
|
import '../types/LabelIdType.js';
|
|
22
|
+
import '../classes/Label.js';
|
|
23
|
+
import '../types/StepLabelType.js';
|
|
24
|
+
import '@drincs/pixi-vn/dist/override';
|
|
25
|
+
import '../classes/LabelAbstract.js';
|
|
26
|
+
import '../types/StepHistoryDataType.js';
|
|
22
27
|
import './export/ExportedCanvas.js';
|
|
23
28
|
import './canvas/ICanvasBaseMemory.js';
|
|
24
29
|
import './export/ExportedStorage.js';
|
|
25
|
-
import '../types/StepHistoryDataType.js';
|
|
26
30
|
import './export/ExportedStep.js';
|
|
27
31
|
import 'pixi.js';
|
|
28
32
|
import '../types/TickerIdType.js';
|
|
29
33
|
import '../types/PauseType.js';
|
|
30
34
|
import '../types/RepeatType.js';
|
|
31
|
-
import '../types/StepLabelType.js';
|
|
32
|
-
import '@drincs/pixi-vn/dist/override';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Label from '../classes/Label.mjs';
|
|
2
2
|
import '../types/LabelIdType.mjs';
|
|
3
3
|
import '../types/StepLabelType.mjs';
|
|
4
4
|
import '@drincs/pixi-vn/dist/override';
|
|
5
|
+
import '../classes/LabelAbstract.mjs';
|
|
5
6
|
import '../types/StepHistoryDataType.mjs';
|
|
7
|
+
import '../interface/LabelProps.mjs';
|
|
6
8
|
|
|
7
9
|
declare const baseCanvasElementTestLabel: Label<{}>;
|
|
8
10
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Label from '../classes/Label.js';
|
|
2
2
|
import '../types/LabelIdType.js';
|
|
3
3
|
import '../types/StepLabelType.js';
|
|
4
4
|
import '@drincs/pixi-vn/dist/override';
|
|
5
|
+
import '../classes/LabelAbstract.js';
|
|
5
6
|
import '../types/StepHistoryDataType.js';
|
|
7
|
+
import '../interface/LabelProps.js';
|
|
6
8
|
|
|
7
9
|
declare const baseCanvasElementTestLabel: Label<{}>;
|
|
8
10
|
|
|
@@ -559,16 +559,14 @@ 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 steps is the list of steps that the label will perform
|
|
567
566
|
* @param props is the properties of the label
|
|
568
567
|
*/
|
|
569
|
-
constructor(id,
|
|
568
|
+
constructor(id, props) {
|
|
570
569
|
this._id = id;
|
|
571
|
-
this._steps = steps;
|
|
572
570
|
this._onStepStart = props == null ? void 0 : props.onStepStart;
|
|
573
571
|
this._onLoadStep = props == null ? void 0 : props.onLoadStep;
|
|
574
572
|
this._onStepEnd = props == null ? void 0 : props.onStepEnd;
|
|
@@ -580,17 +578,6 @@ var Label = class {
|
|
|
580
578
|
get id() {
|
|
581
579
|
return this._id;
|
|
582
580
|
}
|
|
583
|
-
/**
|
|
584
|
-
* Get the steps of the label.
|
|
585
|
-
* This class should be extended and the steps method should be overridden.
|
|
586
|
-
* Every time you update this list will also be updated when the other game versions load.
|
|
587
|
-
*/
|
|
588
|
-
get steps() {
|
|
589
|
-
if (typeof this._steps === "function") {
|
|
590
|
-
return this._steps();
|
|
591
|
-
}
|
|
592
|
-
return this._steps;
|
|
593
|
-
}
|
|
594
581
|
/**
|
|
595
582
|
* Get the corresponding steps number
|
|
596
583
|
* @param externalSteps
|
|
@@ -641,6 +628,28 @@ var Label = class {
|
|
|
641
628
|
}
|
|
642
629
|
};
|
|
643
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
|
+
|
|
644
653
|
// src/classes/CloseLabel.ts
|
|
645
654
|
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
646
655
|
function newCloseLabel(choiseIndex) {
|
|
@@ -652,6 +661,106 @@ function newCloseLabel(choiseIndex) {
|
|
|
652
661
|
// src/types/CloseType.ts
|
|
653
662
|
var Close = "close";
|
|
654
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
|
+
|
|
655
764
|
// src/functions/DialogueUtility.ts
|
|
656
765
|
function setDialogue(props) {
|
|
657
766
|
let text = "";
|
|
@@ -686,13 +795,9 @@ function getChoiceMenuOptions() {
|
|
|
686
795
|
d.forEach((option, index) => {
|
|
687
796
|
if (option.type === Close) {
|
|
688
797
|
let itemLabel = newCloseLabel(index);
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
type: Close,
|
|
693
|
-
closeCurrentLabel: option.closeCurrentLabel,
|
|
694
|
-
props: {}
|
|
695
|
-
});
|
|
798
|
+
let choice = new ChoiceMenuOptionClose(option.text, option.closeCurrentLabel);
|
|
799
|
+
choice.label = itemLabel;
|
|
800
|
+
options.push(choice);
|
|
696
801
|
return;
|
|
697
802
|
}
|
|
698
803
|
let label = getLabelById(option.label);
|
|
@@ -701,9 +806,7 @@ function getChoiceMenuOptions() {
|
|
|
701
806
|
onStepStart: label.onStepStart,
|
|
702
807
|
choiseIndex: index
|
|
703
808
|
});
|
|
704
|
-
options.push(
|
|
705
|
-
label: itemLabel
|
|
706
|
-
}));
|
|
809
|
+
options.push(new ChoiceMenuOption(option.text, itemLabel, option.props, option.type));
|
|
707
810
|
}
|
|
708
811
|
});
|
|
709
812
|
return options;
|