@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/functions/index.mjs
CHANGED
|
@@ -58,16 +58,14 @@ function checkIfStepsIsEqual(step1, step2) {
|
|
|
58
58
|
return step1 === step2;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
// src/classes/
|
|
62
|
-
var
|
|
61
|
+
// src/classes/LabelAbstract.ts
|
|
62
|
+
var LabelAbstract = class {
|
|
63
63
|
/**
|
|
64
64
|
* @param id is the id of the label
|
|
65
|
-
* @param steps is the list of steps that the label will perform
|
|
66
65
|
* @param props is the properties of the label
|
|
67
66
|
*/
|
|
68
|
-
constructor(id,
|
|
67
|
+
constructor(id, props) {
|
|
69
68
|
this._id = id;
|
|
70
|
-
this._steps = steps;
|
|
71
69
|
this._onStepStart = props == null ? void 0 : props.onStepStart;
|
|
72
70
|
this._onLoadStep = props == null ? void 0 : props.onLoadStep;
|
|
73
71
|
this._onStepEnd = props == null ? void 0 : props.onStepEnd;
|
|
@@ -79,17 +77,6 @@ var Label = class {
|
|
|
79
77
|
get id() {
|
|
80
78
|
return this._id;
|
|
81
79
|
}
|
|
82
|
-
/**
|
|
83
|
-
* Get the steps of the label.
|
|
84
|
-
* This class should be extended and the steps method should be overridden.
|
|
85
|
-
* Every time you update this list will also be updated when the other game versions load.
|
|
86
|
-
*/
|
|
87
|
-
get steps() {
|
|
88
|
-
if (typeof this._steps === "function") {
|
|
89
|
-
return this._steps();
|
|
90
|
-
}
|
|
91
|
-
return this._steps;
|
|
92
|
-
}
|
|
93
80
|
/**
|
|
94
81
|
* Get the corresponding steps number
|
|
95
82
|
* @param externalSteps
|
|
@@ -140,6 +127,28 @@ var Label = class {
|
|
|
140
127
|
}
|
|
141
128
|
};
|
|
142
129
|
|
|
130
|
+
// src/classes/Label.ts
|
|
131
|
+
var Label = class extends LabelAbstract {
|
|
132
|
+
/**
|
|
133
|
+
* @param id is the id of the label
|
|
134
|
+
* @param steps is the list of steps that the label will perform
|
|
135
|
+
* @param props is the properties of the label
|
|
136
|
+
*/
|
|
137
|
+
constructor(id, steps, props) {
|
|
138
|
+
super(id, props);
|
|
139
|
+
this._steps = steps;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Get the steps of the label.
|
|
143
|
+
*/
|
|
144
|
+
get steps() {
|
|
145
|
+
if (typeof this._steps === "function") {
|
|
146
|
+
return this._steps();
|
|
147
|
+
}
|
|
148
|
+
return this._steps;
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
143
152
|
// src/classes/CloseLabel.ts
|
|
144
153
|
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
145
154
|
function newCloseLabel(choiseIndex) {
|
|
@@ -158,6 +167,9 @@ function getLabelById(id) {
|
|
|
158
167
|
}
|
|
159
168
|
return label;
|
|
160
169
|
}
|
|
170
|
+
function saveLabel(label) {
|
|
171
|
+
registeredLabels[label.id] = label;
|
|
172
|
+
}
|
|
161
173
|
|
|
162
174
|
// src/functions/ExportUtility.ts
|
|
163
175
|
function createExportableElement(element) {
|
|
@@ -327,7 +339,7 @@ var TickerBase = class {
|
|
|
327
339
|
};
|
|
328
340
|
|
|
329
341
|
// src/constants.ts
|
|
330
|
-
var PIXIVN_VERSION = "0.6.
|
|
342
|
+
var PIXIVN_VERSION = "0.6.7";
|
|
331
343
|
var Repeat = "repeat";
|
|
332
344
|
function Pause(duration) {
|
|
333
345
|
return {
|
|
@@ -2199,6 +2211,62 @@ var GameStepManager = _GameStepManager;
|
|
|
2199
2211
|
var Close = "close";
|
|
2200
2212
|
|
|
2201
2213
|
// src/classes/ChoiceMenuOption.ts
|
|
2214
|
+
var ChoiceMenuOption = class {
|
|
2215
|
+
/**
|
|
2216
|
+
* @param text Text to be displayed in the menu
|
|
2217
|
+
* @param label Label to be opened when the option is selected or the id of the label
|
|
2218
|
+
* @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.
|
|
2219
|
+
* @param type Type of the label to be opened. @default "call"
|
|
2220
|
+
*/
|
|
2221
|
+
constructor(text, label, props, type = "call") {
|
|
2222
|
+
/**
|
|
2223
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
2224
|
+
* @example
|
|
2225
|
+
* ```tsx
|
|
2226
|
+
* setChoiceMenuOptions([
|
|
2227
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
2228
|
+
* ])
|
|
2229
|
+
* return <List>
|
|
2230
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
2231
|
+
* return (
|
|
2232
|
+
* <ChoiceButton
|
|
2233
|
+
* disabled={item.props.disabled}
|
|
2234
|
+
* onClick={() => {
|
|
2235
|
+
* afterSelectChoice(item)
|
|
2236
|
+
* }}
|
|
2237
|
+
* >
|
|
2238
|
+
* {item.text}
|
|
2239
|
+
* </ChoiceButton>
|
|
2240
|
+
* )
|
|
2241
|
+
* })}
|
|
2242
|
+
* </List>
|
|
2243
|
+
* ```
|
|
2244
|
+
*/
|
|
2245
|
+
this.props = {};
|
|
2246
|
+
this.text = text;
|
|
2247
|
+
this._label = label;
|
|
2248
|
+
this.type = type;
|
|
2249
|
+
if (props) {
|
|
2250
|
+
this.props = props;
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
/**
|
|
2254
|
+
* Label to be opened when the option is selected
|
|
2255
|
+
*/
|
|
2256
|
+
get label() {
|
|
2257
|
+
let label = this._label;
|
|
2258
|
+
if (typeof label === "string") {
|
|
2259
|
+
let res = getLabelById(label);
|
|
2260
|
+
if (res) {
|
|
2261
|
+
label = res;
|
|
2262
|
+
} else {
|
|
2263
|
+
console.error(`Label ${label} not found, so it will be closed`);
|
|
2264
|
+
label = newCloseLabel();
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
return label;
|
|
2268
|
+
}
|
|
2269
|
+
};
|
|
2202
2270
|
var ChoiceMenuOptionClose = class {
|
|
2203
2271
|
/**
|
|
2204
2272
|
* @param text Text to be displayed in the menu
|
|
@@ -2288,6 +2356,54 @@ var DialogueBaseModel = class {
|
|
|
2288
2356
|
}
|
|
2289
2357
|
};
|
|
2290
2358
|
|
|
2359
|
+
// src/classes/LabelJson.ts
|
|
2360
|
+
var LabelJson2 = class extends LabelAbstract {
|
|
2361
|
+
/**
|
|
2362
|
+
* @param id is the id of the label
|
|
2363
|
+
* @param steps is the list of steps that the label will perform
|
|
2364
|
+
* @param props is the properties of the label
|
|
2365
|
+
*/
|
|
2366
|
+
constructor(id, steps, props) {
|
|
2367
|
+
super(id, props);
|
|
2368
|
+
this._steps = steps;
|
|
2369
|
+
}
|
|
2370
|
+
/**
|
|
2371
|
+
* Get the steps of the label.
|
|
2372
|
+
*/
|
|
2373
|
+
get steps() {
|
|
2374
|
+
if (typeof this._steps === "function") {
|
|
2375
|
+
return this._steps().map(this.stepConverter);
|
|
2376
|
+
}
|
|
2377
|
+
return this._steps.map(this.stepConverter);
|
|
2378
|
+
}
|
|
2379
|
+
stepConverter(step) {
|
|
2380
|
+
return (props) => {
|
|
2381
|
+
if (step.currentChoiceMenuOptions) {
|
|
2382
|
+
setChoiceMenuOptions(step.currentChoiceMenuOptions);
|
|
2383
|
+
} else {
|
|
2384
|
+
clearChoiceMenuOptions();
|
|
2385
|
+
}
|
|
2386
|
+
if (step.dialog) {
|
|
2387
|
+
setDialogue(step.dialog);
|
|
2388
|
+
} else {
|
|
2389
|
+
clearDialogue();
|
|
2390
|
+
}
|
|
2391
|
+
if (step.labelToOpen) {
|
|
2392
|
+
if (step.labelToOpen.type === "jump") {
|
|
2393
|
+
GameStepManager.jumpLabel(step.labelToOpen.labelId, props);
|
|
2394
|
+
} else {
|
|
2395
|
+
GameStepManager.callLabel(step.labelToOpen.labelId, props);
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
if (step.end === "game_end") {
|
|
2399
|
+
console.warn("[Pixi'VN] Game end not implemented");
|
|
2400
|
+
} else if (step.end === "label_end") {
|
|
2401
|
+
GameStepManager.closeCurrentLabel();
|
|
2402
|
+
}
|
|
2403
|
+
};
|
|
2404
|
+
}
|
|
2405
|
+
};
|
|
2406
|
+
|
|
2291
2407
|
// src/functions/DialogueUtility.ts
|
|
2292
2408
|
function setDialogue(props) {
|
|
2293
2409
|
let text = "";
|
|
@@ -2341,13 +2457,9 @@ function getChoiceMenuOptions() {
|
|
|
2341
2457
|
d.forEach((option, index) => {
|
|
2342
2458
|
if (option.type === Close) {
|
|
2343
2459
|
let itemLabel = newCloseLabel(index);
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
type: Close,
|
|
2348
|
-
closeCurrentLabel: option.closeCurrentLabel,
|
|
2349
|
-
props: {}
|
|
2350
|
-
});
|
|
2460
|
+
let choice = new ChoiceMenuOptionClose(option.text, option.closeCurrentLabel);
|
|
2461
|
+
choice.label = itemLabel;
|
|
2462
|
+
options.push(choice);
|
|
2351
2463
|
return;
|
|
2352
2464
|
}
|
|
2353
2465
|
let label = getLabelById(option.label);
|
|
@@ -2356,9 +2468,7 @@ function getChoiceMenuOptions() {
|
|
|
2356
2468
|
onStepStart: label.onStepStart,
|
|
2357
2469
|
choiseIndex: index
|
|
2358
2470
|
});
|
|
2359
|
-
options.push(
|
|
2360
|
-
label: itemLabel
|
|
2361
|
-
}));
|
|
2471
|
+
options.push(new ChoiceMenuOption(option.text, itemLabel, option.props, option.type));
|
|
2362
2472
|
}
|
|
2363
2473
|
});
|
|
2364
2474
|
return options;
|
|
@@ -2985,6 +3095,37 @@ function zoomOut(tag, props = { direction: "right" }, priority) {
|
|
|
2985
3095
|
GameWindowManager.addTicker(tag, effect);
|
|
2986
3096
|
}
|
|
2987
3097
|
|
|
3098
|
+
// src/functions/Importer.ts
|
|
3099
|
+
function importPixiVNJson(data) {
|
|
3100
|
+
if (Array.isArray(data)) {
|
|
3101
|
+
data.forEach((label) => {
|
|
3102
|
+
importPixiVNJson(label);
|
|
3103
|
+
});
|
|
3104
|
+
return;
|
|
3105
|
+
}
|
|
3106
|
+
try {
|
|
3107
|
+
if (typeof data === "string") {
|
|
3108
|
+
data = JSON.parse(data);
|
|
3109
|
+
}
|
|
3110
|
+
} catch (e) {
|
|
3111
|
+
console.error("[Pixi'VN] Error parsing imported Pixi'VN JSON", e);
|
|
3112
|
+
return;
|
|
3113
|
+
}
|
|
3114
|
+
if (typeof data !== "object") {
|
|
3115
|
+
console.error("[Pixi'VN] Error parsing imported Pixi'VN JSON: data is not an object");
|
|
3116
|
+
return;
|
|
3117
|
+
}
|
|
3118
|
+
for (const labelId in data) {
|
|
3119
|
+
try {
|
|
3120
|
+
const steps = data[labelId];
|
|
3121
|
+
let label = new LabelJson2(labelId, steps);
|
|
3122
|
+
saveLabel(label);
|
|
3123
|
+
} catch (e) {
|
|
3124
|
+
console.error(`[Pixi'VN] Error creating JSON label ${labelId}`, e);
|
|
3125
|
+
}
|
|
3126
|
+
}
|
|
3127
|
+
}
|
|
3128
|
+
|
|
2988
3129
|
// src/functions/SavesUtility.ts
|
|
2989
3130
|
function getSaveData() {
|
|
2990
3131
|
return {
|
|
@@ -3016,6 +3157,6 @@ function jsonToSaveData(json) {
|
|
|
3016
3157
|
return JSON.parse(json);
|
|
3017
3158
|
}
|
|
3018
3159
|
|
|
3019
|
-
export { addImage, clearAllGameDatas, clearChoiceMenuOptions, clearDialogue, getChoiceMenuOptions, getDialogue, getDialogueHistory, getFlag, getSaveData, getSaveJson, getTexture, loadImage, loadSaveData, loadSaveJson, moveIn, moveOut, removeCanvasElement, removeWithDissolveTransition, removeWithFadeTransition, setChoiceMenuOptions, setDialogue, setFlag, showImage, showWithDissolveTransition, showWithFadeTransition, zoomIn, zoomOut };
|
|
3160
|
+
export { addImage, clearAllGameDatas, clearChoiceMenuOptions, clearDialogue, getChoiceMenuOptions, getDialogue, getDialogueHistory, getFlag, getSaveData, getSaveJson, getTexture, importPixiVNJson, loadImage, loadSaveData, loadSaveJson, moveIn, moveOut, removeCanvasElement, removeWithDissolveTransition, removeWithFadeTransition, setChoiceMenuOptions, setDialogue, setFlag, showImage, showWithDissolveTransition, showWithFadeTransition, zoomIn, zoomOut };
|
|
3020
3161
|
//# sourceMappingURL=index.mjs.map
|
|
3021
3162
|
//# sourceMappingURL=index.mjs.map
|