@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
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,8 @@ export { default as CanvasEvent } from './classes/CanvasEvent.mjs';
|
|
|
3
3
|
export { default as CharacterBaseModel } from './classes/CharacterBaseModel.mjs';
|
|
4
4
|
export { default as ChoiceMenuOption, ChoiceMenuOptionClose } from './classes/ChoiceMenuOption.mjs';
|
|
5
5
|
export { default as DialogueBaseModel } from './classes/DialogueBaseModel.mjs';
|
|
6
|
-
export {
|
|
6
|
+
export { default as Label } from './classes/Label.mjs';
|
|
7
|
+
export { default as LabelJson } from './classes/LabelJson.mjs';
|
|
7
8
|
export { default as StoredClassModel } from './classes/StoredClassModel.mjs';
|
|
8
9
|
export { default as CanvasBase } from './classes/canvas/CanvasBase.mjs';
|
|
9
10
|
export { default as CanvasContainer } from './classes/canvas/CanvasContainer.mjs';
|
|
@@ -25,6 +26,7 @@ export { clearChoiceMenuOptions, clearDialogue, getChoiceMenuOptions, getDialogu
|
|
|
25
26
|
export { getFlag, setFlag } from './functions/FlagsUtility.mjs';
|
|
26
27
|
export { clearAllGameDatas } from './functions/GameUtility.mjs';
|
|
27
28
|
export { addImage, loadImage, moveIn, moveOut, removeCanvasElement, removeWithDissolveTransition, removeWithFadeTransition, showImage, showWithDissolveTransition, showWithFadeTransition, zoomIn, zoomOut } from './functions/ImageUtility.mjs';
|
|
29
|
+
export { importPixiVNJson } from './functions/Importer.mjs';
|
|
28
30
|
export { getSaveData, getSaveJson, loadSaveData, loadSaveJson } from './functions/SavesUtility.mjs';
|
|
29
31
|
export { getTexture } from './functions/TextureUtility.mjs';
|
|
30
32
|
export { default as CharacterBaseModelProps } from './interface/CharacterBaseModelProps.mjs';
|
|
@@ -33,6 +35,7 @@ export { default as IHistoryStep, IHistoryStepData } from './interface/IHistoryS
|
|
|
33
35
|
export { default as IOpenedLabel } from './interface/IOpenedLabel.mjs';
|
|
34
36
|
export { default as ISaveData } from './interface/ISaveData.mjs';
|
|
35
37
|
export { default as ITickersSteps } from './interface/ITickersSteps.mjs';
|
|
38
|
+
export { default as LabelProps } from './interface/LabelProps.mjs';
|
|
36
39
|
export { default as TickerHistory, TickerHistoryForExport } from './interface/TickerHistory.mjs';
|
|
37
40
|
export { TickerProgrationType } from './interface/TickerProgrationType.mjs';
|
|
38
41
|
export { default as TickerTimeoutHistory } from './interface/TickerTimeoutHistory.mjs';
|
|
@@ -54,9 +57,11 @@ export { default as CanvasEventNamesType } from './types/CanvasEventNamesType.mj
|
|
|
54
57
|
export { ChoiceMenuOptionsType } from './types/ChoiceMenuOptionsType.mjs';
|
|
55
58
|
export { Close, CloseType } from './types/CloseType.mjs';
|
|
56
59
|
export { default as HistoryChoiceMenuOption } from './types/HistoryChoiceMenuOption.mjs';
|
|
60
|
+
export { default as LabelJsonType } from './types/LabelJsonType.mjs';
|
|
57
61
|
export { default as LabelRunModeType } from './types/LabelRunModeType.mjs';
|
|
58
62
|
export { PauseType } from './types/PauseType.mjs';
|
|
59
63
|
export { RepeatType } from './types/RepeatType.mjs';
|
|
64
|
+
export { default as StepLabelJsonType } from './types/StepLabelJsonType.mjs';
|
|
60
65
|
export { StepLabelPropsType, StepLabelResultType, StepLabelType } from './types/StepLabelType.mjs';
|
|
61
66
|
export { StorageElementType, StorageObjectType } from './types/StorageElementType.mjs';
|
|
62
67
|
export { FadeAlphaTickerProps } from './types/ticker/FadeAlphaTickerProps.mjs';
|
|
@@ -65,6 +70,7 @@ export { RotateTickerProps } from './types/ticker/RotateTickerProps.mjs';
|
|
|
65
70
|
export { ZoomTickerProps } from './types/ticker/ZoomTickerProps.mjs';
|
|
66
71
|
import './types/EventIdType.mjs';
|
|
67
72
|
import './types/LabelIdType.mjs';
|
|
73
|
+
import './classes/LabelAbstract.mjs';
|
|
68
74
|
import './types/StepHistoryDataType.mjs';
|
|
69
75
|
import './types/TickerIdType.mjs';
|
|
70
76
|
import './types/CanvasElementTagType.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export { default as CanvasEvent } from './classes/CanvasEvent.js';
|
|
|
3
3
|
export { default as CharacterBaseModel } from './classes/CharacterBaseModel.js';
|
|
4
4
|
export { default as ChoiceMenuOption, ChoiceMenuOptionClose } from './classes/ChoiceMenuOption.js';
|
|
5
5
|
export { default as DialogueBaseModel } from './classes/DialogueBaseModel.js';
|
|
6
|
-
export {
|
|
6
|
+
export { default as Label } from './classes/Label.js';
|
|
7
|
+
export { default as LabelJson } from './classes/LabelJson.js';
|
|
7
8
|
export { default as StoredClassModel } from './classes/StoredClassModel.js';
|
|
8
9
|
export { default as CanvasBase } from './classes/canvas/CanvasBase.js';
|
|
9
10
|
export { default as CanvasContainer } from './classes/canvas/CanvasContainer.js';
|
|
@@ -25,6 +26,7 @@ export { clearChoiceMenuOptions, clearDialogue, getChoiceMenuOptions, getDialogu
|
|
|
25
26
|
export { getFlag, setFlag } from './functions/FlagsUtility.js';
|
|
26
27
|
export { clearAllGameDatas } from './functions/GameUtility.js';
|
|
27
28
|
export { addImage, loadImage, moveIn, moveOut, removeCanvasElement, removeWithDissolveTransition, removeWithFadeTransition, showImage, showWithDissolveTransition, showWithFadeTransition, zoomIn, zoomOut } from './functions/ImageUtility.js';
|
|
29
|
+
export { importPixiVNJson } from './functions/Importer.js';
|
|
28
30
|
export { getSaveData, getSaveJson, loadSaveData, loadSaveJson } from './functions/SavesUtility.js';
|
|
29
31
|
export { getTexture } from './functions/TextureUtility.js';
|
|
30
32
|
export { default as CharacterBaseModelProps } from './interface/CharacterBaseModelProps.js';
|
|
@@ -33,6 +35,7 @@ export { default as IHistoryStep, IHistoryStepData } from './interface/IHistoryS
|
|
|
33
35
|
export { default as IOpenedLabel } from './interface/IOpenedLabel.js';
|
|
34
36
|
export { default as ISaveData } from './interface/ISaveData.js';
|
|
35
37
|
export { default as ITickersSteps } from './interface/ITickersSteps.js';
|
|
38
|
+
export { default as LabelProps } from './interface/LabelProps.js';
|
|
36
39
|
export { default as TickerHistory, TickerHistoryForExport } from './interface/TickerHistory.js';
|
|
37
40
|
export { TickerProgrationType } from './interface/TickerProgrationType.js';
|
|
38
41
|
export { default as TickerTimeoutHistory } from './interface/TickerTimeoutHistory.js';
|
|
@@ -54,9 +57,11 @@ export { default as CanvasEventNamesType } from './types/CanvasEventNamesType.js
|
|
|
54
57
|
export { ChoiceMenuOptionsType } from './types/ChoiceMenuOptionsType.js';
|
|
55
58
|
export { Close, CloseType } from './types/CloseType.js';
|
|
56
59
|
export { default as HistoryChoiceMenuOption } from './types/HistoryChoiceMenuOption.js';
|
|
60
|
+
export { default as LabelJsonType } from './types/LabelJsonType.js';
|
|
57
61
|
export { default as LabelRunModeType } from './types/LabelRunModeType.js';
|
|
58
62
|
export { PauseType } from './types/PauseType.js';
|
|
59
63
|
export { RepeatType } from './types/RepeatType.js';
|
|
64
|
+
export { default as StepLabelJsonType } from './types/StepLabelJsonType.js';
|
|
60
65
|
export { StepLabelPropsType, StepLabelResultType, StepLabelType } from './types/StepLabelType.js';
|
|
61
66
|
export { StorageElementType, StorageObjectType } from './types/StorageElementType.js';
|
|
62
67
|
export { FadeAlphaTickerProps } from './types/ticker/FadeAlphaTickerProps.js';
|
|
@@ -65,6 +70,7 @@ export { RotateTickerProps } from './types/ticker/RotateTickerProps.js';
|
|
|
65
70
|
export { ZoomTickerProps } from './types/ticker/ZoomTickerProps.js';
|
|
66
71
|
import './types/EventIdType.js';
|
|
67
72
|
import './types/LabelIdType.js';
|
|
73
|
+
import './classes/LabelAbstract.js';
|
|
68
74
|
import './types/StepHistoryDataType.js';
|
|
69
75
|
import './types/TickerIdType.js';
|
|
70
76
|
import './types/CanvasElementTagType.js';
|
package/dist/index.js
CHANGED
|
@@ -78,16 +78,14 @@ function checkIfStepsIsEqual(step1, step2) {
|
|
|
78
78
|
return step1 === step2;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
// src/classes/
|
|
82
|
-
var
|
|
81
|
+
// src/classes/LabelAbstract.ts
|
|
82
|
+
var LabelAbstract = class {
|
|
83
83
|
/**
|
|
84
84
|
* @param id is the id of the label
|
|
85
|
-
* @param steps is the list of steps that the label will perform
|
|
86
85
|
* @param props is the properties of the label
|
|
87
86
|
*/
|
|
88
|
-
constructor(id,
|
|
87
|
+
constructor(id, props) {
|
|
89
88
|
this._id = id;
|
|
90
|
-
this._steps = steps;
|
|
91
89
|
this._onStepStart = props == null ? void 0 : props.onStepStart;
|
|
92
90
|
this._onLoadStep = props == null ? void 0 : props.onLoadStep;
|
|
93
91
|
this._onStepEnd = props == null ? void 0 : props.onStepEnd;
|
|
@@ -99,17 +97,6 @@ var Label = class {
|
|
|
99
97
|
get id() {
|
|
100
98
|
return this._id;
|
|
101
99
|
}
|
|
102
|
-
/**
|
|
103
|
-
* Get the steps of the label.
|
|
104
|
-
* This class should be extended and the steps method should be overridden.
|
|
105
|
-
* Every time you update this list will also be updated when the other game versions load.
|
|
106
|
-
*/
|
|
107
|
-
get steps() {
|
|
108
|
-
if (typeof this._steps === "function") {
|
|
109
|
-
return this._steps();
|
|
110
|
-
}
|
|
111
|
-
return this._steps;
|
|
112
|
-
}
|
|
113
100
|
/**
|
|
114
101
|
* Get the corresponding steps number
|
|
115
102
|
* @param externalSteps
|
|
@@ -160,6 +147,28 @@ var Label = class {
|
|
|
160
147
|
}
|
|
161
148
|
};
|
|
162
149
|
|
|
150
|
+
// src/classes/Label.ts
|
|
151
|
+
var Label = class extends LabelAbstract {
|
|
152
|
+
/**
|
|
153
|
+
* @param id is the id of the label
|
|
154
|
+
* @param steps is the list of steps that the label will perform
|
|
155
|
+
* @param props is the properties of the label
|
|
156
|
+
*/
|
|
157
|
+
constructor(id, steps, props) {
|
|
158
|
+
super(id, props);
|
|
159
|
+
this._steps = steps;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Get the steps of the label.
|
|
163
|
+
*/
|
|
164
|
+
get steps() {
|
|
165
|
+
if (typeof this._steps === "function") {
|
|
166
|
+
return this._steps();
|
|
167
|
+
}
|
|
168
|
+
return this._steps;
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
|
|
163
172
|
// src/classes/CloseLabel.ts
|
|
164
173
|
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
165
174
|
function newCloseLabel(choiseIndex) {
|
|
@@ -186,6 +195,9 @@ function getLabelById(id) {
|
|
|
186
195
|
}
|
|
187
196
|
return label;
|
|
188
197
|
}
|
|
198
|
+
function saveLabel(label) {
|
|
199
|
+
registeredLabels[label.id] = label;
|
|
200
|
+
}
|
|
189
201
|
var CanvasBase = class extends pixi_js.Container {
|
|
190
202
|
constructor() {
|
|
191
203
|
super(...arguments);
|
|
@@ -807,21 +819,29 @@ var ChoiceMenuOption = class {
|
|
|
807
819
|
* ```
|
|
808
820
|
*/
|
|
809
821
|
this.props = {};
|
|
810
|
-
if (typeof label === "string") {
|
|
811
|
-
let tLabel = getLabelById(label);
|
|
812
|
-
if (!tLabel) {
|
|
813
|
-
throw new Error(`[Pixi'VN] Label ${label} not found`);
|
|
814
|
-
} else {
|
|
815
|
-
label = tLabel;
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
822
|
this.text = text;
|
|
819
|
-
this.
|
|
823
|
+
this._label = label;
|
|
820
824
|
this.type = type;
|
|
821
825
|
if (props) {
|
|
822
826
|
this.props = props;
|
|
823
827
|
}
|
|
824
828
|
}
|
|
829
|
+
/**
|
|
830
|
+
* Label to be opened when the option is selected
|
|
831
|
+
*/
|
|
832
|
+
get label() {
|
|
833
|
+
let label = this._label;
|
|
834
|
+
if (typeof label === "string") {
|
|
835
|
+
let res = getLabelById(label);
|
|
836
|
+
if (res) {
|
|
837
|
+
label = res;
|
|
838
|
+
} else {
|
|
839
|
+
console.error(`Label ${label} not found, so it will be closed`);
|
|
840
|
+
label = newCloseLabel();
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
return label;
|
|
844
|
+
}
|
|
825
845
|
};
|
|
826
846
|
var ChoiceMenuOptionClose = class {
|
|
827
847
|
/**
|
|
@@ -919,13 +939,9 @@ function getChoiceMenuOptions() {
|
|
|
919
939
|
d.forEach((option, index) => {
|
|
920
940
|
if (option.type === Close) {
|
|
921
941
|
let itemLabel = newCloseLabel(index);
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
type: Close,
|
|
926
|
-
closeCurrentLabel: option.closeCurrentLabel,
|
|
927
|
-
props: {}
|
|
928
|
-
});
|
|
942
|
+
let choice = new ChoiceMenuOptionClose(option.text, option.closeCurrentLabel);
|
|
943
|
+
choice.label = itemLabel;
|
|
944
|
+
options.push(choice);
|
|
929
945
|
return;
|
|
930
946
|
}
|
|
931
947
|
let label = getLabelById(option.label);
|
|
@@ -934,9 +950,7 @@ function getChoiceMenuOptions() {
|
|
|
934
950
|
onStepStart: label.onStepStart,
|
|
935
951
|
choiseIndex: index
|
|
936
952
|
});
|
|
937
|
-
options.push(
|
|
938
|
-
label: itemLabel
|
|
939
|
-
}));
|
|
953
|
+
options.push(new ChoiceMenuOption(option.text, itemLabel, option.props, option.type));
|
|
940
954
|
}
|
|
941
955
|
});
|
|
942
956
|
return options;
|
|
@@ -1340,7 +1354,7 @@ var ZoomInOutTicker = class extends exports.ZoomTicker {
|
|
|
1340
1354
|
};
|
|
1341
1355
|
|
|
1342
1356
|
// src/constants.ts
|
|
1343
|
-
var PIXIVN_VERSION = "0.6.
|
|
1357
|
+
var PIXIVN_VERSION = "0.6.7";
|
|
1344
1358
|
var Repeat = "repeat";
|
|
1345
1359
|
function Pause(duration) {
|
|
1346
1360
|
return {
|
|
@@ -1605,6 +1619,37 @@ function zoomOut(tag, props = { direction: "right" }, priority) {
|
|
|
1605
1619
|
GameWindowManager.addTicker(tag, effect);
|
|
1606
1620
|
}
|
|
1607
1621
|
|
|
1622
|
+
// src/functions/Importer.ts
|
|
1623
|
+
function importPixiVNJson(data) {
|
|
1624
|
+
if (Array.isArray(data)) {
|
|
1625
|
+
data.forEach((label) => {
|
|
1626
|
+
importPixiVNJson(label);
|
|
1627
|
+
});
|
|
1628
|
+
return;
|
|
1629
|
+
}
|
|
1630
|
+
try {
|
|
1631
|
+
if (typeof data === "string") {
|
|
1632
|
+
data = JSON.parse(data);
|
|
1633
|
+
}
|
|
1634
|
+
} catch (e) {
|
|
1635
|
+
console.error("[Pixi'VN] Error parsing imported Pixi'VN JSON", e);
|
|
1636
|
+
return;
|
|
1637
|
+
}
|
|
1638
|
+
if (typeof data !== "object") {
|
|
1639
|
+
console.error("[Pixi'VN] Error parsing imported Pixi'VN JSON: data is not an object");
|
|
1640
|
+
return;
|
|
1641
|
+
}
|
|
1642
|
+
for (const labelId in data) {
|
|
1643
|
+
try {
|
|
1644
|
+
const steps = data[labelId];
|
|
1645
|
+
let label = new LabelJson2(labelId, steps);
|
|
1646
|
+
saveLabel(label);
|
|
1647
|
+
} catch (e) {
|
|
1648
|
+
console.error(`[Pixi'VN] Error creating JSON label ${labelId}`, e);
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1608
1653
|
// src/functions/SavesUtility.ts
|
|
1609
1654
|
function getSaveData() {
|
|
1610
1655
|
return {
|
|
@@ -3284,6 +3329,54 @@ var DialogueBaseModel = class {
|
|
|
3284
3329
|
}
|
|
3285
3330
|
};
|
|
3286
3331
|
|
|
3332
|
+
// src/classes/LabelJson.ts
|
|
3333
|
+
var LabelJson2 = class extends LabelAbstract {
|
|
3334
|
+
/**
|
|
3335
|
+
* @param id is the id of the label
|
|
3336
|
+
* @param steps is the list of steps that the label will perform
|
|
3337
|
+
* @param props is the properties of the label
|
|
3338
|
+
*/
|
|
3339
|
+
constructor(id, steps, props) {
|
|
3340
|
+
super(id, props);
|
|
3341
|
+
this._steps = steps;
|
|
3342
|
+
}
|
|
3343
|
+
/**
|
|
3344
|
+
* Get the steps of the label.
|
|
3345
|
+
*/
|
|
3346
|
+
get steps() {
|
|
3347
|
+
if (typeof this._steps === "function") {
|
|
3348
|
+
return this._steps().map(this.stepConverter);
|
|
3349
|
+
}
|
|
3350
|
+
return this._steps.map(this.stepConverter);
|
|
3351
|
+
}
|
|
3352
|
+
stepConverter(step) {
|
|
3353
|
+
return (props) => {
|
|
3354
|
+
if (step.currentChoiceMenuOptions) {
|
|
3355
|
+
setChoiceMenuOptions(step.currentChoiceMenuOptions);
|
|
3356
|
+
} else {
|
|
3357
|
+
clearChoiceMenuOptions();
|
|
3358
|
+
}
|
|
3359
|
+
if (step.dialog) {
|
|
3360
|
+
setDialogue(step.dialog);
|
|
3361
|
+
} else {
|
|
3362
|
+
clearDialogue();
|
|
3363
|
+
}
|
|
3364
|
+
if (step.labelToOpen) {
|
|
3365
|
+
if (step.labelToOpen.type === "jump") {
|
|
3366
|
+
GameStepManager.jumpLabel(step.labelToOpen.labelId, props);
|
|
3367
|
+
} else {
|
|
3368
|
+
GameStepManager.callLabel(step.labelToOpen.labelId, props);
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
if (step.end === "game_end") {
|
|
3372
|
+
console.warn("[Pixi'VN] Game end not implemented");
|
|
3373
|
+
} else if (step.end === "label_end") {
|
|
3374
|
+
GameStepManager.closeCurrentLabel();
|
|
3375
|
+
}
|
|
3376
|
+
};
|
|
3377
|
+
}
|
|
3378
|
+
};
|
|
3379
|
+
|
|
3287
3380
|
// src/labels/TestConstant.ts
|
|
3288
3381
|
var juliette = new CharacterBaseModel2("___pixivn_juliette___", {
|
|
3289
3382
|
name: "Juliette",
|
|
@@ -4129,6 +4222,7 @@ exports.GameStepManager = GameStepManager;
|
|
|
4129
4222
|
exports.GameStorageManager = GameStorageManager;
|
|
4130
4223
|
exports.GameWindowManager = GameWindowManager;
|
|
4131
4224
|
exports.Label = Label;
|
|
4225
|
+
exports.LabelJson = LabelJson2;
|
|
4132
4226
|
exports.Pause = Pause;
|
|
4133
4227
|
exports.Repeat = Repeat;
|
|
4134
4228
|
exports.StoredClassModel = StoredClassModel;
|
|
@@ -4149,6 +4243,7 @@ exports.getLabelById = getLabelById;
|
|
|
4149
4243
|
exports.getSaveData = getSaveData;
|
|
4150
4244
|
exports.getSaveJson = getSaveJson;
|
|
4151
4245
|
exports.getTexture = getTexture;
|
|
4246
|
+
exports.importPixiVNJson = importPixiVNJson;
|
|
4152
4247
|
exports.juliette = juliette;
|
|
4153
4248
|
exports.loadImage = loadImage;
|
|
4154
4249
|
exports.loadSaveData = loadSaveData;
|