@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
|
@@ -2,18 +2,21 @@ import { ChoiceMenuOptionClose } from '../classes/ChoiceMenuOption.mjs';
|
|
|
2
2
|
import { StepLabelPropsType, StepLabelResultType } from '../types/StepLabelType.mjs';
|
|
3
3
|
import CharacterBaseModel from '../classes/CharacterBaseModel.mjs';
|
|
4
4
|
import DialogueBaseModel from '../classes/DialogueBaseModel.mjs';
|
|
5
|
-
import
|
|
6
|
-
import ExportedStep from '../interface/export/ExportedStep.mjs';
|
|
5
|
+
import Label from '../classes/Label.mjs';
|
|
7
6
|
import IHistoryStep from '../interface/IHistoryStep.mjs';
|
|
8
7
|
import IOpenedLabel from '../interface/IOpenedLabel.mjs';
|
|
8
|
+
import ExportedStep from '../interface/export/ExportedStep.mjs';
|
|
9
9
|
import { LabelIdType } from '../types/LabelIdType.mjs';
|
|
10
10
|
import '../types/StorageElementType.mjs';
|
|
11
11
|
import '../types/CloseType.mjs';
|
|
12
12
|
import '../types/LabelRunModeType.mjs';
|
|
13
13
|
import '@drincs/pixi-vn/dist/override';
|
|
14
|
+
import '../classes/LabelAbstract.mjs';
|
|
14
15
|
import '../types/StepHistoryDataType.mjs';
|
|
16
|
+
import '../interface/LabelProps.mjs';
|
|
15
17
|
import '../interface/CharacterBaseModelProps.mjs';
|
|
16
18
|
import '../classes/StoredClassModel.mjs';
|
|
19
|
+
import 'deep-diff';
|
|
17
20
|
import '../interface/export/ExportedCanvas.mjs';
|
|
18
21
|
import '../interface/canvas/ICanvasBaseMemory.mjs';
|
|
19
22
|
import '../interface/ITickersSteps.mjs';
|
|
@@ -24,7 +27,6 @@ import '../types/PauseType.mjs';
|
|
|
24
27
|
import '../types/RepeatType.mjs';
|
|
25
28
|
import '../interface/TickerHistory.mjs';
|
|
26
29
|
import '../interface/export/ExportedStorage.mjs';
|
|
27
|
-
import 'deep-diff';
|
|
28
30
|
|
|
29
31
|
/**
|
|
30
32
|
* GameStepManager is a class that manages the steps and labels of the game.
|
|
@@ -2,18 +2,21 @@ import { ChoiceMenuOptionClose } from '../classes/ChoiceMenuOption.js';
|
|
|
2
2
|
import { StepLabelPropsType, StepLabelResultType } from '../types/StepLabelType.js';
|
|
3
3
|
import CharacterBaseModel from '../classes/CharacterBaseModel.js';
|
|
4
4
|
import DialogueBaseModel from '../classes/DialogueBaseModel.js';
|
|
5
|
-
import
|
|
6
|
-
import ExportedStep from '../interface/export/ExportedStep.js';
|
|
5
|
+
import Label from '../classes/Label.js';
|
|
7
6
|
import IHistoryStep from '../interface/IHistoryStep.js';
|
|
8
7
|
import IOpenedLabel from '../interface/IOpenedLabel.js';
|
|
8
|
+
import ExportedStep from '../interface/export/ExportedStep.js';
|
|
9
9
|
import { LabelIdType } from '../types/LabelIdType.js';
|
|
10
10
|
import '../types/StorageElementType.js';
|
|
11
11
|
import '../types/CloseType.js';
|
|
12
12
|
import '../types/LabelRunModeType.js';
|
|
13
13
|
import '@drincs/pixi-vn/dist/override';
|
|
14
|
+
import '../classes/LabelAbstract.js';
|
|
14
15
|
import '../types/StepHistoryDataType.js';
|
|
16
|
+
import '../interface/LabelProps.js';
|
|
15
17
|
import '../interface/CharacterBaseModelProps.js';
|
|
16
18
|
import '../classes/StoredClassModel.js';
|
|
19
|
+
import 'deep-diff';
|
|
17
20
|
import '../interface/export/ExportedCanvas.js';
|
|
18
21
|
import '../interface/canvas/ICanvasBaseMemory.js';
|
|
19
22
|
import '../interface/ITickersSteps.js';
|
|
@@ -24,7 +27,6 @@ import '../types/PauseType.js';
|
|
|
24
27
|
import '../types/RepeatType.js';
|
|
25
28
|
import '../interface/TickerHistory.js';
|
|
26
29
|
import '../interface/export/ExportedStorage.js';
|
|
27
|
-
import 'deep-diff';
|
|
28
30
|
|
|
29
31
|
/**
|
|
30
32
|
* GameStepManager is a class that manages the steps and labels of the game.
|
|
@@ -64,16 +64,14 @@ function checkIfStepsIsEqual(step1, step2) {
|
|
|
64
64
|
return step1 === step2;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
// src/classes/
|
|
68
|
-
var
|
|
67
|
+
// src/classes/LabelAbstract.ts
|
|
68
|
+
var LabelAbstract = class {
|
|
69
69
|
/**
|
|
70
70
|
* @param id is the id of the label
|
|
71
|
-
* @param steps is the list of steps that the label will perform
|
|
72
71
|
* @param props is the properties of the label
|
|
73
72
|
*/
|
|
74
|
-
constructor(id,
|
|
73
|
+
constructor(id, props) {
|
|
75
74
|
this._id = id;
|
|
76
|
-
this._steps = steps;
|
|
77
75
|
this._onStepStart = props == null ? void 0 : props.onStepStart;
|
|
78
76
|
this._onLoadStep = props == null ? void 0 : props.onLoadStep;
|
|
79
77
|
this._onStepEnd = props == null ? void 0 : props.onStepEnd;
|
|
@@ -85,17 +83,6 @@ var Label = class {
|
|
|
85
83
|
get id() {
|
|
86
84
|
return this._id;
|
|
87
85
|
}
|
|
88
|
-
/**
|
|
89
|
-
* Get the steps of the label.
|
|
90
|
-
* This class should be extended and the steps method should be overridden.
|
|
91
|
-
* Every time you update this list will also be updated when the other game versions load.
|
|
92
|
-
*/
|
|
93
|
-
get steps() {
|
|
94
|
-
if (typeof this._steps === "function") {
|
|
95
|
-
return this._steps();
|
|
96
|
-
}
|
|
97
|
-
return this._steps;
|
|
98
|
-
}
|
|
99
86
|
/**
|
|
100
87
|
* Get the corresponding steps number
|
|
101
88
|
* @param externalSteps
|
|
@@ -146,6 +133,28 @@ var Label = class {
|
|
|
146
133
|
}
|
|
147
134
|
};
|
|
148
135
|
|
|
136
|
+
// src/classes/Label.ts
|
|
137
|
+
var Label = class extends LabelAbstract {
|
|
138
|
+
/**
|
|
139
|
+
* @param id is the id of the label
|
|
140
|
+
* @param steps is the list of steps that the label will perform
|
|
141
|
+
* @param props is the properties of the label
|
|
142
|
+
*/
|
|
143
|
+
constructor(id, steps, props) {
|
|
144
|
+
super(id, props);
|
|
145
|
+
this._steps = steps;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Get the steps of the label.
|
|
149
|
+
*/
|
|
150
|
+
get steps() {
|
|
151
|
+
if (typeof this._steps === "function") {
|
|
152
|
+
return this._steps();
|
|
153
|
+
}
|
|
154
|
+
return this._steps;
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
149
158
|
// src/classes/CloseLabel.ts
|
|
150
159
|
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
151
160
|
function newCloseLabel(choiseIndex) {
|
|
@@ -1530,16 +1539,105 @@ var GameWindowManager = _GameWindowManager;
|
|
|
1530
1539
|
// src/types/CloseType.ts
|
|
1531
1540
|
var Close = "close";
|
|
1532
1541
|
|
|
1533
|
-
// src/
|
|
1534
|
-
var
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1542
|
+
// src/classes/ChoiceMenuOption.ts
|
|
1543
|
+
var ChoiceMenuOption = class {
|
|
1544
|
+
/**
|
|
1545
|
+
* @param text Text to be displayed in the menu
|
|
1546
|
+
* @param label Label to be opened when the option is selected or the id of the label
|
|
1547
|
+
* @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.
|
|
1548
|
+
* @param type Type of the label to be opened. @default "call"
|
|
1549
|
+
*/
|
|
1550
|
+
constructor(text, label, props, type = "call") {
|
|
1551
|
+
/**
|
|
1552
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
1553
|
+
* @example
|
|
1554
|
+
* ```tsx
|
|
1555
|
+
* setChoiceMenuOptions([
|
|
1556
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
1557
|
+
* ])
|
|
1558
|
+
* return <List>
|
|
1559
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
1560
|
+
* return (
|
|
1561
|
+
* <ChoiceButton
|
|
1562
|
+
* disabled={item.props.disabled}
|
|
1563
|
+
* onClick={() => {
|
|
1564
|
+
* afterSelectChoice(item)
|
|
1565
|
+
* }}
|
|
1566
|
+
* >
|
|
1567
|
+
* {item.text}
|
|
1568
|
+
* </ChoiceButton>
|
|
1569
|
+
* )
|
|
1570
|
+
* })}
|
|
1571
|
+
* </List>
|
|
1572
|
+
* ```
|
|
1573
|
+
*/
|
|
1574
|
+
this.props = {};
|
|
1575
|
+
this.text = text;
|
|
1576
|
+
this._label = label;
|
|
1577
|
+
this.type = type;
|
|
1578
|
+
if (props) {
|
|
1579
|
+
this.props = props;
|
|
1580
|
+
}
|
|
1540
1581
|
}
|
|
1541
|
-
|
|
1542
|
-
|
|
1582
|
+
/**
|
|
1583
|
+
* Label to be opened when the option is selected
|
|
1584
|
+
*/
|
|
1585
|
+
get label() {
|
|
1586
|
+
let label = this._label;
|
|
1587
|
+
if (typeof label === "string") {
|
|
1588
|
+
let res = getLabelById(label);
|
|
1589
|
+
if (res) {
|
|
1590
|
+
label = res;
|
|
1591
|
+
} else {
|
|
1592
|
+
console.error(`Label ${label} not found, so it will be closed`);
|
|
1593
|
+
label = newCloseLabel();
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
return label;
|
|
1597
|
+
}
|
|
1598
|
+
};
|
|
1599
|
+
var ChoiceMenuOptionClose = class {
|
|
1600
|
+
/**
|
|
1601
|
+
* @param text Text to be displayed in the menu
|
|
1602
|
+
* @param closeCurrentLabel If true, the current label will be closed. @default false
|
|
1603
|
+
*/
|
|
1604
|
+
constructor(text, closeCurrentLabel = false) {
|
|
1605
|
+
/**
|
|
1606
|
+
* Label to be opened when the option is selected
|
|
1607
|
+
*/
|
|
1608
|
+
this.label = newCloseLabel();
|
|
1609
|
+
/**
|
|
1610
|
+
* Type of the label to be opened
|
|
1611
|
+
*/
|
|
1612
|
+
this.type = Close;
|
|
1613
|
+
/**
|
|
1614
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
1615
|
+
* @example
|
|
1616
|
+
* ```tsx
|
|
1617
|
+
* setChoiceMenuOptions([
|
|
1618
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
1619
|
+
* ])
|
|
1620
|
+
* return <List>
|
|
1621
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
1622
|
+
* return (
|
|
1623
|
+
* <ChoiceButton
|
|
1624
|
+
* disabled={item.props.disabled}
|
|
1625
|
+
* onClick={() => {
|
|
1626
|
+
* afterSelectChoice(item)
|
|
1627
|
+
* }}
|
|
1628
|
+
* >
|
|
1629
|
+
* {item.text}
|
|
1630
|
+
* </ChoiceButton>
|
|
1631
|
+
* )
|
|
1632
|
+
* })}
|
|
1633
|
+
* </List>
|
|
1634
|
+
* ```
|
|
1635
|
+
*/
|
|
1636
|
+
this.props = {};
|
|
1637
|
+
this.text = text;
|
|
1638
|
+
this.closeCurrentLabel = closeCurrentLabel;
|
|
1639
|
+
}
|
|
1640
|
+
};
|
|
1543
1641
|
|
|
1544
1642
|
// src/functions/DialogueUtility.ts
|
|
1545
1643
|
function getDialogue() {
|
|
@@ -1552,13 +1650,9 @@ function getChoiceMenuOptions() {
|
|
|
1552
1650
|
d.forEach((option, index) => {
|
|
1553
1651
|
if (option.type === Close) {
|
|
1554
1652
|
let itemLabel = newCloseLabel(index);
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
type: Close,
|
|
1559
|
-
closeCurrentLabel: option.closeCurrentLabel,
|
|
1560
|
-
props: {}
|
|
1561
|
-
});
|
|
1653
|
+
let choice = new ChoiceMenuOptionClose(option.text, option.closeCurrentLabel);
|
|
1654
|
+
choice.label = itemLabel;
|
|
1655
|
+
options.push(choice);
|
|
1562
1656
|
return;
|
|
1563
1657
|
}
|
|
1564
1658
|
let label = getLabelById(option.label);
|
|
@@ -1567,9 +1661,7 @@ function getChoiceMenuOptions() {
|
|
|
1567
1661
|
onStepStart: label.onStepStart,
|
|
1568
1662
|
choiseIndex: index
|
|
1569
1663
|
});
|
|
1570
|
-
options.push(
|
|
1571
|
-
label: itemLabel
|
|
1572
|
-
}));
|
|
1664
|
+
options.push(new ChoiceMenuOption(option.text, itemLabel, option.props, option.type));
|
|
1573
1665
|
}
|
|
1574
1666
|
});
|
|
1575
1667
|
return options;
|
|
@@ -1863,6 +1955,17 @@ ZoomTicker = __decorateClass([
|
|
|
1863
1955
|
tickerDecorator()
|
|
1864
1956
|
], ZoomTicker);
|
|
1865
1957
|
|
|
1958
|
+
// src/decorators/LabelDecorator.ts
|
|
1959
|
+
var registeredLabels = {};
|
|
1960
|
+
function getLabelById(id) {
|
|
1961
|
+
let label = registeredLabels[id];
|
|
1962
|
+
if (!label) {
|
|
1963
|
+
console.error(`[Pixi'VN] Label ${id} not found`);
|
|
1964
|
+
return;
|
|
1965
|
+
}
|
|
1966
|
+
return label;
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1866
1969
|
// src/functions/DiffUtility.ts
|
|
1867
1970
|
function restoreDeepDiffChanges(data, differences) {
|
|
1868
1971
|
let result = createExportableElement(data);
|