@drincs/pixi-vn-json 1.12.1 → 1.13.1
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 +40 -29
- package/dist/{importer.d.cts → PixiVNJsonLabelStep-C-9WKwTo.d.cts} +479 -77
- package/dist/{importer.d.ts → PixiVNJsonLabelStep-C-9WKwTo.d.ts} +479 -77
- package/dist/PixiVNJsonLabelStep-DQx6TBvZ.d.cts +999 -0
- package/dist/PixiVNJsonLabelStep-DQx6TBvZ.d.ts +999 -0
- package/dist/actions.cjs +3 -0
- package/dist/actions.d.cts +127 -0
- package/dist/actions.d.ts +127 -0
- package/dist/actions.mjs +3 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +33 -541
- package/dist/core.d.ts +33 -541
- package/dist/core.mjs +1 -1
- package/dist/index.cjs +2 -3
- package/dist/index.d.cts +557 -21
- package/dist/index.d.ts +557 -21
- package/dist/index.mjs +2 -3
- package/dist/interpreter.cjs +1 -0
- package/dist/interpreter.d.cts +96 -0
- package/dist/interpreter.d.ts +96 -0
- package/dist/interpreter.mjs +1 -0
- package/dist/schema.cjs +1 -0
- package/dist/schema.d.cts +41 -0
- package/dist/schema.d.ts +41 -0
- package/dist/schema.mjs +0 -0
- package/dist/translator.cjs +1 -1
- package/dist/translator.d.cts +513 -13
- package/dist/translator.d.ts +513 -13
- package/dist/translator.mjs +1 -1
- package/package.json +33 -4
- package/dist/importer.cjs +0 -1
- package/dist/importer.mjs +0 -1
|
@@ -1,18 +1,36 @@
|
|
|
1
|
-
import { LabelAbstract, LabelProps, StepLabelPropsType as StepLabelPropsType$1, StepLabelType } from '@drincs/pixi-vn/narration';
|
|
2
1
|
import { StorageElementType, CanvasBaseInterface, ImageSprite, ShakeEffectProps, ShowWithDissolveTransitionProps, ShowWithFadeTransitionProps, MoveInOutProps, ZoomInOutProps, PushInOutProps, ImageContainerOptions, ImageSpriteOptions, TextOptions, ImageSpriteMemory, VideoSpriteMemory, ImageContainerMemory, TextMemory, ContainerOptions, ContainerMemory, SoundPlayOptionsWithChannel, MediaInterface, LabelRunModeType, StorageObjectType, StepLabelPropsType } from '@drincs/pixi-vn';
|
|
3
2
|
import { KeyframesType, AnimationOptions, ObjectSegment, ObjectSegmentWithTransition, SequenceOptions } from '@drincs/pixi-vn/motion';
|
|
4
3
|
import { UPDATE_PRIORITY } from 'pixi.js';
|
|
5
4
|
|
|
5
|
+
/**
|
|
6
|
+
* A single element that can appear inside a step-switch, which may be a direct value,
|
|
7
|
+
* a conditional statement, or a result-to-combine.
|
|
8
|
+
*/
|
|
6
9
|
type PixiVNJsonStepSwitchElementType<Then> = Then | PixiVNJsonConditionalStatements<Then> | PixiVNJsonConditionalResultToCombine<Then>;
|
|
10
|
+
/**
|
|
11
|
+
* The elements collection of a step-switch — either a plain array or a conditional that produces an array.
|
|
12
|
+
*/
|
|
7
13
|
type PixiVNJsonStepSwitchElementsType<Then> = PixiVNJsonStepSwitchElementType<Then>[] | PixiVNJsonConditionalStatements<Then[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Picks one element at random each time the step is visited.
|
|
16
|
+
*/
|
|
8
17
|
interface PixiVNJsonRandom<Then> {
|
|
9
18
|
type: "stepswitch";
|
|
10
19
|
choiceType: "random";
|
|
20
|
+
/**
|
|
21
|
+
* The pool of elements to choose from randomly.
|
|
22
|
+
*/
|
|
11
23
|
elements: PixiVNJsonStepSwitchElementsType<Then>;
|
|
12
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Picks elements in a random order, advancing through the list across visits (no repeats until exhausted).
|
|
27
|
+
*/
|
|
13
28
|
interface PixiVNJsonSequentialRandom<Then> {
|
|
14
29
|
type: "stepswitch";
|
|
15
30
|
choiceType: "sequentialrandom";
|
|
31
|
+
/**
|
|
32
|
+
* The pool of elements to iterate through in randomised order.
|
|
33
|
+
*/
|
|
16
34
|
elements: PixiVNJsonStepSwitchElementsType<Then>;
|
|
17
35
|
/**
|
|
18
36
|
* When the sequential ends, what should be the value? If undefined, it will return undefined.
|
|
@@ -20,13 +38,19 @@ interface PixiVNJsonSequentialRandom<Then> {
|
|
|
20
38
|
*/
|
|
21
39
|
end: undefined | "lastItem";
|
|
22
40
|
/**
|
|
23
|
-
* The subId is used for
|
|
41
|
+
* The subId is used for managing nested switches
|
|
24
42
|
*/
|
|
25
43
|
nestedId?: string;
|
|
26
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Advances through the elements list one by one on each visit (in order).
|
|
47
|
+
*/
|
|
27
48
|
interface PixiVNJsonSequential<Then> {
|
|
28
49
|
type: "stepswitch";
|
|
29
50
|
choiceType: "sequential";
|
|
51
|
+
/**
|
|
52
|
+
* The ordered list of elements to iterate through.
|
|
53
|
+
*/
|
|
30
54
|
elements: PixiVNJsonStepSwitchElementsType<Then>;
|
|
31
55
|
/**
|
|
32
56
|
* When the sequential ends, what should be the value? If undefined, it will return undefined.
|
|
@@ -34,16 +58,28 @@ interface PixiVNJsonSequential<Then> {
|
|
|
34
58
|
*/
|
|
35
59
|
end: undefined | "lastItem";
|
|
36
60
|
/**
|
|
37
|
-
* The subId is used for
|
|
61
|
+
* The subId is used for managing nested switches
|
|
38
62
|
*/
|
|
39
63
|
nestedId?: string;
|
|
40
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Loops through the elements list indefinitely, cycling back to the first element after the last.
|
|
67
|
+
*/
|
|
41
68
|
interface PixiVNJsonLoop<Then> {
|
|
42
69
|
type: "stepswitch";
|
|
43
70
|
choiceType: "loop";
|
|
71
|
+
/**
|
|
72
|
+
* The list of elements to cycle through.
|
|
73
|
+
*/
|
|
44
74
|
elements: PixiVNJsonStepSwitchElementsType<Then>;
|
|
75
|
+
/**
|
|
76
|
+
* The subId is used for managing nested switches
|
|
77
|
+
*/
|
|
45
78
|
nestedId?: string;
|
|
46
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* A step-switch selects one element from a list using a defined strategy (random, sequential, loop, or sequential-random).
|
|
82
|
+
*/
|
|
47
83
|
type PixiVNJsonStepSwitch<Then> = PixiVNJsonRandom<Then> | PixiVNJsonSequential<Then> | PixiVNJsonLoop<Then> | PixiVNJsonSequentialRandom<Then>;
|
|
48
84
|
|
|
49
85
|
/**
|
|
@@ -53,15 +89,33 @@ type PixiVNJsonStepSwitch<Then> = PixiVNJsonRandom<Then> | PixiVNJsonSequential<
|
|
|
53
89
|
type PixiVNJsonConditionalResultToCombine<T> = {
|
|
54
90
|
type: "resulttocombine";
|
|
55
91
|
/**
|
|
56
|
-
*
|
|
92
|
+
* Defines how the two results are combined:
|
|
93
|
+
* - `"cross"` — cartesian product / pairwise combination of both results
|
|
94
|
+
* - `"union"` — concatenation / merge of both results into a single collection
|
|
57
95
|
*/
|
|
58
96
|
combine: "cross" | "union";
|
|
97
|
+
/**
|
|
98
|
+
* The first (primary) result item, used as a fallback if the second conditional produces no result.
|
|
99
|
+
*/
|
|
59
100
|
firstItem?: T;
|
|
101
|
+
/**
|
|
102
|
+
* The second conditional item(s) whose result will be combined with {@link firstItem}.
|
|
103
|
+
*/
|
|
60
104
|
secondConditionalItem?: PixiVNJsonStepSwitchElementType<T>[];
|
|
61
105
|
};
|
|
62
106
|
|
|
107
|
+
/**
|
|
108
|
+
* A conditional statement that evaluates to a value of type `Then`.
|
|
109
|
+
* It can be either:
|
|
110
|
+
* - a {@link PixiVNJsonStepSwitch} — selects a result from a list based on a strategy (random, sequential, loop)
|
|
111
|
+
* - a {@link PixiVNJsonIfElse} — evaluates a condition and returns the matching branch result,
|
|
112
|
+
* which may itself be another conditional or a {@link PixiVNJsonConditionalResultToCombine}
|
|
113
|
+
*/
|
|
63
114
|
type PixiVNJsonConditionalStatements<Then> = PixiVNJsonStepSwitch<Then> | PixiVNJsonIfElse<Then | PixiVNJsonConditionalStatements<Then> | PixiVNJsonConditionalResultToCombine<Then>>;
|
|
64
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Retrieves a value from the persistent storage, flag storage, or temporary storage.
|
|
118
|
+
*/
|
|
65
119
|
type PixiVNJsonStorageGet = {
|
|
66
120
|
type: "value";
|
|
67
121
|
storageOperationType: "get";
|
|
@@ -79,11 +133,14 @@ type PixiVNJsonParamGet = {
|
|
|
79
133
|
type: "value";
|
|
80
134
|
storageOperationType: "get";
|
|
81
135
|
/**
|
|
82
|
-
*
|
|
136
|
+
* Index of the parameter in the params array.
|
|
83
137
|
*/
|
|
84
138
|
key: number;
|
|
85
139
|
storageType: "params";
|
|
86
140
|
};
|
|
141
|
+
/**
|
|
142
|
+
* Retrieves the number of times a label has been opened.
|
|
143
|
+
*/
|
|
87
144
|
type PixiVNJsonLabelGet = {
|
|
88
145
|
type: "value";
|
|
89
146
|
storageOperationType: "get";
|
|
@@ -96,6 +153,9 @@ type PixiVNJsonLabelGet = {
|
|
|
96
153
|
*/
|
|
97
154
|
storageType: "label";
|
|
98
155
|
};
|
|
156
|
+
/**
|
|
157
|
+
* Retrieves the number of times a specific choice has been selected.
|
|
158
|
+
*/
|
|
99
159
|
type PixiVNJsonChoiceGet = {
|
|
100
160
|
type: "value";
|
|
101
161
|
storageOperationType: "get";
|
|
@@ -108,13 +168,41 @@ type PixiVNJsonChoiceGet = {
|
|
|
108
168
|
*/
|
|
109
169
|
storageType: "choice";
|
|
110
170
|
};
|
|
171
|
+
/**
|
|
172
|
+
* Retrieves a value from the logic/arithmetic layer (result of a computation or condition).
|
|
173
|
+
*/
|
|
111
174
|
type PixiVNJsonLogicGet = {
|
|
112
175
|
type: "value";
|
|
113
176
|
storageOperationType: "get";
|
|
177
|
+
/**
|
|
178
|
+
* The arithmetic or conditional operation whose result is the retrieved value.
|
|
179
|
+
*/
|
|
114
180
|
operation: PixiVNJsonArithmeticOperations | PixiVNJsonConditions;
|
|
115
181
|
storageType: "logic";
|
|
116
182
|
};
|
|
117
|
-
|
|
183
|
+
/**
|
|
184
|
+
* Union of all "get value" operations — reads from storage, params, labels, choices, or a logic expression.
|
|
185
|
+
*/
|
|
186
|
+
type PixiVNJsonValueGet = PixiVNJsonStorageGet | PixiVNJsonParamGet | PixiVNJsonLabelGet | PixiVNJsonChoiceGet | PixiVNJsonLogicGet | PixiVNJsonFunction;
|
|
187
|
+
/**
|
|
188
|
+
* Invokes a named function and returns its result.
|
|
189
|
+
* Functions are registered in the Pixi'VN runtime and can receive typed arguments.
|
|
190
|
+
*/
|
|
191
|
+
type PixiVNJsonFunction = {
|
|
192
|
+
type: "function";
|
|
193
|
+
/**
|
|
194
|
+
* The name of the registered function to call.
|
|
195
|
+
*/
|
|
196
|
+
functionName: string;
|
|
197
|
+
/**
|
|
198
|
+
* Arguments to pass to the function. Each argument can be a condition, a raw value,
|
|
199
|
+
* a value-get operation, or an arithmetic expression.
|
|
200
|
+
*/
|
|
201
|
+
args: (PixiVNJsonConditions | StorageElementType | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations)[];
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* Sets a value in either the persistent storage or the temporary (session) storage.
|
|
205
|
+
*/
|
|
118
206
|
type PixiVNJsonOnlyStorageSet = {
|
|
119
207
|
type: "value";
|
|
120
208
|
storageOperationType: "set";
|
|
@@ -131,19 +219,26 @@ type PixiVNJsonOnlyStorageSet = {
|
|
|
131
219
|
*/
|
|
132
220
|
storageType: "storage" | "tempstorage";
|
|
133
221
|
};
|
|
222
|
+
/**
|
|
223
|
+
* Sets a positional parameter value in the params temporary storage.
|
|
224
|
+
*/
|
|
134
225
|
type PixiVNJsonOnlyParamSet = {
|
|
135
226
|
type: "value";
|
|
136
227
|
storageOperationType: "set";
|
|
137
228
|
/**
|
|
138
|
-
*
|
|
229
|
+
* Index of the parameter in the params array to set.
|
|
139
230
|
*/
|
|
140
231
|
key: number;
|
|
141
232
|
/**
|
|
142
|
-
* Value to be set
|
|
233
|
+
* Value to be set at the given param index.
|
|
143
234
|
*/
|
|
144
235
|
value: StorageElementType | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditionalStatements<StorageElementType>;
|
|
145
236
|
storageType: "params";
|
|
146
237
|
};
|
|
238
|
+
/**
|
|
239
|
+
* Sets a boolean flag in the flag storage.
|
|
240
|
+
* Flag storage is a dedicated boolean key-value store queried with {@link getFlag}.
|
|
241
|
+
*/
|
|
147
242
|
type PixiVNJsonFlagSet = {
|
|
148
243
|
type: "value";
|
|
149
244
|
storageOperationType: "set";
|
|
@@ -160,8 +255,14 @@ type PixiVNJsonFlagSet = {
|
|
|
160
255
|
*/
|
|
161
256
|
storageType: "flagStorage";
|
|
162
257
|
};
|
|
258
|
+
/**
|
|
259
|
+
* Union of all "set value" operations — writes to storage, flag storage, or params.
|
|
260
|
+
*/
|
|
163
261
|
type PixiVNJsonValueSet = PixiVNJsonOnlyStorageSet | PixiVNJsonFlagSet | PixiVNJsonOnlyParamSet;
|
|
164
262
|
|
|
263
|
+
/**
|
|
264
|
+
* Binary arithmetic operation between two values (left OP right).
|
|
265
|
+
*/
|
|
165
266
|
interface PixiVNJsonArithmeticOperationsArithmetic {
|
|
166
267
|
type: "arithmetic";
|
|
167
268
|
/**
|
|
@@ -173,10 +274,21 @@ interface PixiVNJsonArithmeticOperationsArithmetic {
|
|
|
173
274
|
*/
|
|
174
275
|
rightValue: StorageElementType | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditionalStatements<StorageElementType | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations>;
|
|
175
276
|
/**
|
|
176
|
-
* Operator of the arithmetic operation
|
|
177
|
-
|
|
178
|
-
|
|
277
|
+
* Operator of the arithmetic operation:
|
|
278
|
+
* - `"*"` multiplication
|
|
279
|
+
* - `"/"` division
|
|
280
|
+
* - `"+"` addition (concatenation for strings and arrays)
|
|
281
|
+
* - `"-"` subtraction (removal of elements for arrays)
|
|
282
|
+
* - `"%"` modulo
|
|
283
|
+
* - `"POW"` exponentiation
|
|
284
|
+
* - `"RANDOM"` random integer between leftValue and rightValue (inclusive)
|
|
285
|
+
* - `"INTERSECTION"` intersection of two arrays (only elements present in both arrays are included in the result)
|
|
286
|
+
*/
|
|
287
|
+
operator: "*" | "/" | "+" | "-" | "%" | "POW" | "RANDOM" | "INTERSECTION";
|
|
179
288
|
}
|
|
289
|
+
/**
|
|
290
|
+
* Unary arithmetic operation applied to a single value (e.g. INT, FLOOR, FLOAT).
|
|
291
|
+
*/
|
|
180
292
|
interface PixiVNJsonArithmeticOperationsArithmeticSingle {
|
|
181
293
|
type: "arithmeticsingle";
|
|
182
294
|
/**
|
|
@@ -184,7 +296,10 @@ interface PixiVNJsonArithmeticOperationsArithmeticSingle {
|
|
|
184
296
|
*/
|
|
185
297
|
leftValue: StorageElementType | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditionalStatements<StorageElementType | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations>;
|
|
186
298
|
/**
|
|
187
|
-
* Operator of the arithmetic operation
|
|
299
|
+
* Operator of the arithmetic operation:
|
|
300
|
+
* - `"INT"` truncates the value to an integer (removes the decimal part)
|
|
301
|
+
* - `"FLOOR"` rounds down to the nearest integer
|
|
302
|
+
* - `"FLOAT"` converts the value to a floating-point number
|
|
188
303
|
*/
|
|
189
304
|
operator: "INT" | "FLOOR" | "FLOAT";
|
|
190
305
|
}
|
|
@@ -193,18 +308,48 @@ interface PixiVNJsonArithmeticOperationsArithmeticSingle {
|
|
|
193
308
|
*/
|
|
194
309
|
type PixiVNJsonArithmeticOperations = PixiVNJsonArithmeticOperationsArithmeticSingle | PixiVNJsonArithmeticOperationsArithmetic;
|
|
195
310
|
|
|
311
|
+
/**
|
|
312
|
+
* Combines multiple conditions with a logical AND or OR.
|
|
313
|
+
*/
|
|
196
314
|
type PixiVNJsonUnionConditionAndOr = {
|
|
197
315
|
type: "union";
|
|
316
|
+
/**
|
|
317
|
+
* The list of conditions to combine.
|
|
318
|
+
*/
|
|
198
319
|
conditions: PixiVNJsonConditions[];
|
|
320
|
+
/**
|
|
321
|
+
* - `"and"` — all conditions must be true
|
|
322
|
+
* - `"or"` — at least one condition must be true
|
|
323
|
+
*/
|
|
199
324
|
unionType: "and" | "or";
|
|
200
325
|
};
|
|
326
|
+
/**
|
|
327
|
+
* Negates a single condition with a logical NOT.
|
|
328
|
+
*/
|
|
201
329
|
type PixiVNJsonUnionConditionNot = {
|
|
202
330
|
type: "union";
|
|
331
|
+
/**
|
|
332
|
+
* The condition to negate.
|
|
333
|
+
*/
|
|
203
334
|
condition: PixiVNJsonConditions;
|
|
204
335
|
unionType: "not";
|
|
205
336
|
};
|
|
337
|
+
/**
|
|
338
|
+
* Union of AND/OR and NOT logical operators over conditions.
|
|
339
|
+
*/
|
|
206
340
|
type PixiVNJsonUnionCondition = PixiVNJsonUnionConditionAndOr | PixiVNJsonUnionConditionNot;
|
|
207
341
|
|
|
342
|
+
/**
|
|
343
|
+
* Supported comparison operators.
|
|
344
|
+
* - `"=="` equal
|
|
345
|
+
* - `"!="` not equal
|
|
346
|
+
* - `"<"` less than
|
|
347
|
+
* - `"<="` less than or equal
|
|
348
|
+
* - `">"` greater than
|
|
349
|
+
* - `">="` greater than or equal
|
|
350
|
+
* - `"CONTAINS"` checks whether the left string/array contains the right value, if left and right are arrays, checks if all items in right are included in left
|
|
351
|
+
*/
|
|
352
|
+
type PixiVNJsonComparationOperatorsType = "==" | "!=" | "<" | "<=" | ">" | ">=" | "CONTAINS";
|
|
208
353
|
/**
|
|
209
354
|
* Comparation for PixiVNJson.
|
|
210
355
|
* In this comparation, the values to be converted to string and compared.
|
|
@@ -222,11 +367,18 @@ type PixiVNJsonComparation = {
|
|
|
222
367
|
/**
|
|
223
368
|
* Operator of the comparation
|
|
224
369
|
*/
|
|
225
|
-
operator:
|
|
370
|
+
operator: PixiVNJsonComparationOperatorsType;
|
|
226
371
|
};
|
|
372
|
+
/**
|
|
373
|
+
* A plain value condition — truthy/falsy evaluation of a raw value or a value-get result.
|
|
374
|
+
*/
|
|
227
375
|
type PixiVNJsonValueCondition = StorageElementType | PixiVNJsonValueGet;
|
|
228
376
|
/**
|
|
229
|
-
*
|
|
377
|
+
* Union of all condition types supported by PixiVNJson:
|
|
378
|
+
* - {@link PixiVNJsonComparation} — binary comparison between two values
|
|
379
|
+
* - {@link PixiVNJsonValueCondition} — truthy/falsy check on a plain value
|
|
380
|
+
* - {@link PixiVNJsonUnionCondition} — logical AND, OR, or NOT of other conditions
|
|
381
|
+
* - {@link PixiVNJsonArithmeticOperations} — arithmetic result used as a boolean (non-zero = true)
|
|
230
382
|
*/
|
|
231
383
|
type PixiVNJsonConditions = PixiVNJsonComparation | PixiVNJsonValueCondition | PixiVNJsonUnionCondition | PixiVNJsonArithmeticOperations;
|
|
232
384
|
|
|
@@ -237,6 +389,13 @@ interface PixiVNJsonIfElse<Then> {
|
|
|
237
389
|
type: "ifelse";
|
|
238
390
|
/**
|
|
239
391
|
* The list of conditions to be checked.
|
|
392
|
+
*
|
|
393
|
+
* if is a {@link StorageElementType} or a {@link PixiVNJsonValueGet}:
|
|
394
|
+
* - if is a array or object, the condition is true if not empty
|
|
395
|
+
* - if is a string, the condition is true if not empty
|
|
396
|
+
* - if is a number, the condition is true if not zero
|
|
397
|
+
* - if is a boolean, the condition is true if true
|
|
398
|
+
* - if is null or undefined, the condition is false
|
|
240
399
|
*/
|
|
241
400
|
condition: PixiVNJsonConditions;
|
|
242
401
|
/**
|
|
@@ -249,187 +408,470 @@ interface PixiVNJsonIfElse<Then> {
|
|
|
249
408
|
else?: Then | PixiVNJsonIfElse<Then>;
|
|
250
409
|
}
|
|
251
410
|
|
|
411
|
+
/**
|
|
412
|
+
* Animates one or more canvas elements simultaneously using keyframe-based animation.
|
|
413
|
+
*/
|
|
252
414
|
type PixiVNJsonAnimateBase<T extends CanvasBaseInterface<any>> = {
|
|
253
415
|
type: "animate";
|
|
416
|
+
/**
|
|
417
|
+
* Alias (or list of aliases) of the canvas elements to animate.
|
|
418
|
+
*/
|
|
254
419
|
alias: string | string[];
|
|
420
|
+
/**
|
|
421
|
+
* The keyframes that define the animation values over time.
|
|
422
|
+
*/
|
|
255
423
|
keyframes: KeyframesType<T>;
|
|
424
|
+
/**
|
|
425
|
+
* Additional options controlling the animation (duration, easing, repeat, etc.).
|
|
426
|
+
*/
|
|
256
427
|
options?: AnimationOptions;
|
|
428
|
+
/**
|
|
429
|
+
* Pixi.js update priority for this animation ticker callback.
|
|
430
|
+
*/
|
|
257
431
|
priority?: UPDATE_PRIORITY;
|
|
258
432
|
};
|
|
433
|
+
/**
|
|
434
|
+
* Animates a canvas element using a sequence of segments (timeline-based animation).
|
|
435
|
+
*/
|
|
259
436
|
type PixiVNJsonAnimateSequence<T extends CanvasBaseInterface<any>> = {
|
|
260
437
|
type: "animate-sequence";
|
|
438
|
+
/**
|
|
439
|
+
* Alias of the canvas element to animate.
|
|
440
|
+
*/
|
|
261
441
|
alias: string;
|
|
442
|
+
/**
|
|
443
|
+
* Ordered list of animation segments, each optionally including a transition.
|
|
444
|
+
*/
|
|
262
445
|
sequence: (ObjectSegment<T> | ObjectSegmentWithTransition<T>)[];
|
|
446
|
+
/**
|
|
447
|
+
* Additional options controlling the sequence playback.
|
|
448
|
+
*/
|
|
263
449
|
options?: SequenceOptions;
|
|
450
|
+
/**
|
|
451
|
+
* Pixi.js update priority for this animation ticker callback.
|
|
452
|
+
*/
|
|
264
453
|
priority?: UPDATE_PRIORITY;
|
|
265
454
|
};
|
|
455
|
+
/**
|
|
456
|
+
* Union of all canvas animation operations — keyframe-based or sequence-based.
|
|
457
|
+
*/
|
|
266
458
|
type PixiVNJsonCanvasAnimate<T extends CanvasBaseInterface<any> = ImageSprite> = PixiVNJsonAnimateBase<T> | PixiVNJsonAnimateSequence<T>;
|
|
267
459
|
|
|
460
|
+
/**
|
|
461
|
+
* Applies a shake effect to a canvas element.
|
|
462
|
+
*/
|
|
268
463
|
type PixiVNJsonEffectShake = {
|
|
269
464
|
type: "shake";
|
|
465
|
+
/**
|
|
466
|
+
* Alias of the canvas element to apply the shake effect to.
|
|
467
|
+
*/
|
|
270
468
|
alias: string;
|
|
469
|
+
/**
|
|
470
|
+
* Configuration properties for the shake effect (amplitude, duration, etc.).
|
|
471
|
+
*/
|
|
271
472
|
props: ShakeEffectProps;
|
|
473
|
+
/**
|
|
474
|
+
* Pixi.js update priority for the effect ticker callback.
|
|
475
|
+
*/
|
|
272
476
|
priority?: UPDATE_PRIORITY;
|
|
273
477
|
};
|
|
478
|
+
/**
|
|
479
|
+
* Union of all canvas visual effects.
|
|
480
|
+
*/
|
|
274
481
|
type PixiVNJsonCanvasEffect = PixiVNJsonEffectShake;
|
|
275
482
|
|
|
483
|
+
/**
|
|
484
|
+
* Cross-dissolve transition — blends the element in or out by gradually changing its opacity.
|
|
485
|
+
*/
|
|
276
486
|
type DissolveTransition = {
|
|
277
487
|
type: "dissolve";
|
|
488
|
+
/**
|
|
489
|
+
* Configuration options for the dissolve transition.
|
|
490
|
+
*/
|
|
278
491
|
props?: ShowWithDissolveTransitionProps;
|
|
492
|
+
/**
|
|
493
|
+
* Pixi.js update priority for the transition ticker callback.
|
|
494
|
+
*/
|
|
279
495
|
priority?: UPDATE_PRIORITY;
|
|
280
496
|
};
|
|
497
|
+
/**
|
|
498
|
+
* Fade transition — fades the element in or out by animating its alpha value.
|
|
499
|
+
*/
|
|
281
500
|
type FadeTransition = {
|
|
282
501
|
type: "fade";
|
|
502
|
+
/**
|
|
503
|
+
* Configuration options for the fade transition.
|
|
504
|
+
*/
|
|
283
505
|
props?: ShowWithFadeTransitionProps;
|
|
506
|
+
/**
|
|
507
|
+
* Pixi.js update priority for the transition ticker callback.
|
|
508
|
+
*/
|
|
284
509
|
priority?: UPDATE_PRIORITY;
|
|
285
510
|
};
|
|
511
|
+
/**
|
|
512
|
+
* Move-in / Move-out transition — slides the element into or out of the viewport.
|
|
513
|
+
*/
|
|
286
514
|
type MoveInOutTransition = {
|
|
287
515
|
type: "movein" | "moveout";
|
|
516
|
+
/**
|
|
517
|
+
* Configuration options for the move transition (direction, duration, easing, etc.).
|
|
518
|
+
*/
|
|
288
519
|
props?: MoveInOutProps;
|
|
520
|
+
/**
|
|
521
|
+
* Pixi.js update priority for the transition ticker callback.
|
|
522
|
+
*/
|
|
289
523
|
priority?: UPDATE_PRIORITY;
|
|
290
524
|
};
|
|
525
|
+
/**
|
|
526
|
+
* Zoom-in / Zoom-out transition — scales the element into or out of view.
|
|
527
|
+
*/
|
|
291
528
|
type ZoomInOutTransition = {
|
|
292
529
|
type: "zoomin" | "zoomout";
|
|
530
|
+
/**
|
|
531
|
+
* Configuration options for the zoom transition (scale, duration, easing, etc.).
|
|
532
|
+
*/
|
|
293
533
|
props?: ZoomInOutProps;
|
|
534
|
+
/**
|
|
535
|
+
* Pixi.js update priority for the transition ticker callback.
|
|
536
|
+
*/
|
|
294
537
|
priority?: UPDATE_PRIORITY;
|
|
295
538
|
};
|
|
539
|
+
/**
|
|
540
|
+
* Push-in / Push-out transition — pushes the element onto or off the viewport, displacing the current content.
|
|
541
|
+
*/
|
|
296
542
|
type PushInOutTransition = {
|
|
297
543
|
type: "pushin" | "pushout";
|
|
544
|
+
/**
|
|
545
|
+
* Configuration options for the push transition (direction, duration, easing, etc.).
|
|
546
|
+
*/
|
|
298
547
|
props?: PushInOutProps;
|
|
548
|
+
/**
|
|
549
|
+
* Pixi.js update priority for the transition ticker callback.
|
|
550
|
+
*/
|
|
299
551
|
priority?: UPDATE_PRIORITY;
|
|
300
552
|
};
|
|
553
|
+
/**
|
|
554
|
+
* Union of all supported canvas media transitions.
|
|
555
|
+
*/
|
|
301
556
|
type PixiVNJsonMediaTransiotions = DissolveTransition | FadeTransition | MoveInOutTransition | ZoomInOutTransition | PushInOutTransition;
|
|
302
557
|
|
|
558
|
+
/**
|
|
559
|
+
* Shows an image or video asset on the canvas.
|
|
560
|
+
*/
|
|
303
561
|
type PixiVNJsonCanvasImageVideoShow = {
|
|
304
562
|
type: "image" | "video";
|
|
305
563
|
operationType: "show";
|
|
564
|
+
/**
|
|
565
|
+
* Unique identifier (alias) used to reference this element on the canvas.
|
|
566
|
+
*/
|
|
306
567
|
alias: string;
|
|
307
568
|
/**
|
|
308
569
|
* The url of the image or video.
|
|
309
570
|
* If the url is not provided, the url will be set to the alias.
|
|
310
571
|
*/
|
|
311
572
|
url?: string;
|
|
573
|
+
/**
|
|
574
|
+
* Display options (position, scale, alpha, etc.) for the image or video sprite.
|
|
575
|
+
*/
|
|
312
576
|
props?: ImageSpriteOptions;
|
|
577
|
+
/**
|
|
578
|
+
* Optional transition effect applied when the element appears on screen.
|
|
579
|
+
*/
|
|
313
580
|
transition?: PixiVNJsonMediaTransiotions;
|
|
314
581
|
};
|
|
582
|
+
/**
|
|
583
|
+
* Shows an image container (a group of layered images) on the canvas.
|
|
584
|
+
*/
|
|
315
585
|
type PixiVNJsonCanvasImageContainerShow = {
|
|
316
586
|
type: "imagecontainer";
|
|
317
587
|
operationType: "show";
|
|
588
|
+
/**
|
|
589
|
+
* Unique identifier (alias) used to reference this element on the canvas.
|
|
590
|
+
*/
|
|
318
591
|
alias: string;
|
|
592
|
+
/**
|
|
593
|
+
* The ordered list of image URLs that compose the container layers.
|
|
594
|
+
*/
|
|
319
595
|
urls: string[];
|
|
596
|
+
/**
|
|
597
|
+
* Display options for the image container.
|
|
598
|
+
*/
|
|
320
599
|
props?: ImageContainerOptions<ImageSprite>;
|
|
600
|
+
/**
|
|
601
|
+
* Optional transition effect applied when the element appears on screen.
|
|
602
|
+
*/
|
|
321
603
|
transition?: PixiVNJsonMediaTransiotions;
|
|
322
604
|
};
|
|
605
|
+
/**
|
|
606
|
+
* Shows a text element on the canvas.
|
|
607
|
+
*/
|
|
323
608
|
type PixiVNJsonCanvasTextShow = {
|
|
324
609
|
type: "text";
|
|
325
610
|
operationType: "show";
|
|
611
|
+
/**
|
|
612
|
+
* Unique identifier (alias) used to reference this element on the canvas.
|
|
613
|
+
*/
|
|
326
614
|
alias: string;
|
|
615
|
+
/**
|
|
616
|
+
* The string content to display.
|
|
617
|
+
*/
|
|
327
618
|
text: string;
|
|
619
|
+
/**
|
|
620
|
+
* Display options (font, style, position, etc.) for the text element.
|
|
621
|
+
*/
|
|
328
622
|
props?: TextOptions;
|
|
623
|
+
/**
|
|
624
|
+
* Optional transition effect applied when the element appears on screen.
|
|
625
|
+
*/
|
|
329
626
|
transition?: PixiVNJsonMediaTransiotions;
|
|
330
627
|
};
|
|
628
|
+
/**
|
|
629
|
+
* Edits the properties of an existing image sprite on the canvas.
|
|
630
|
+
*/
|
|
331
631
|
type PixiVNJsonImageEdit = {
|
|
332
632
|
type: "image";
|
|
333
633
|
operationType: "edit";
|
|
634
|
+
/**
|
|
635
|
+
* Alias of the canvas element to edit.
|
|
636
|
+
*/
|
|
334
637
|
alias: string;
|
|
638
|
+
/**
|
|
639
|
+
* Partial memory/state properties to update on the image sprite.
|
|
640
|
+
*/
|
|
335
641
|
props?: Partial<ImageSpriteMemory>;
|
|
336
642
|
};
|
|
643
|
+
/**
|
|
644
|
+
* Edits the properties of an existing video sprite on the canvas.
|
|
645
|
+
*/
|
|
337
646
|
type PixiVNJsonVideoEdit = {
|
|
338
647
|
type: "video";
|
|
339
648
|
operationType: "edit";
|
|
649
|
+
/**
|
|
650
|
+
* Alias of the canvas element to edit.
|
|
651
|
+
*/
|
|
340
652
|
alias: string;
|
|
653
|
+
/**
|
|
654
|
+
* Partial memory/state properties to update on the video sprite.
|
|
655
|
+
*/
|
|
341
656
|
props?: Partial<VideoSpriteMemory>;
|
|
342
657
|
};
|
|
658
|
+
/**
|
|
659
|
+
* Edits the properties of an existing image container on the canvas.
|
|
660
|
+
*/
|
|
343
661
|
type PixiVNJsonImageContainerEdit = {
|
|
344
662
|
type: "imagecontainer";
|
|
345
663
|
operationType: "edit";
|
|
664
|
+
/**
|
|
665
|
+
* Alias of the canvas element to edit.
|
|
666
|
+
*/
|
|
346
667
|
alias: string;
|
|
668
|
+
/**
|
|
669
|
+
* Partial memory/state properties to update on the image container.
|
|
670
|
+
*/
|
|
347
671
|
props?: Partial<ImageContainerMemory>;
|
|
348
672
|
};
|
|
673
|
+
/**
|
|
674
|
+
* Edits the properties of an existing text element on the canvas.
|
|
675
|
+
*/
|
|
349
676
|
type PixiVNJsonTextEdit = {
|
|
350
677
|
type: "text";
|
|
351
678
|
operationType: "edit";
|
|
679
|
+
/**
|
|
680
|
+
* Alias of the canvas element to edit.
|
|
681
|
+
*/
|
|
352
682
|
alias: string;
|
|
683
|
+
/**
|
|
684
|
+
* Partial memory/state properties to update on the text element.
|
|
685
|
+
*/
|
|
353
686
|
props?: Partial<TextMemory>;
|
|
354
687
|
};
|
|
688
|
+
/**
|
|
689
|
+
* Edits the properties of an unknown/generic canvas element.
|
|
690
|
+
* Use this when the specific element type is not one of the built-in kinds.
|
|
691
|
+
*/
|
|
355
692
|
type PixiVNJsonUnknownEdit<T extends ContainerOptions<any>> = {
|
|
356
693
|
type: "canvaselement";
|
|
357
694
|
operationType: "edit";
|
|
695
|
+
/**
|
|
696
|
+
* Alias of the canvas element to edit.
|
|
697
|
+
*/
|
|
358
698
|
alias: string;
|
|
699
|
+
/**
|
|
700
|
+
* Partial options/properties to update on the canvas element.
|
|
701
|
+
*/
|
|
359
702
|
props?: Partial<T>;
|
|
360
703
|
};
|
|
704
|
+
/**
|
|
705
|
+
* Removes a canvas element from the stage, optionally with a transition.
|
|
706
|
+
*/
|
|
361
707
|
type PixiVNJsonCanvasRemove = {
|
|
362
708
|
type: "image" | "video" | "imagecontainer" | "canvaselement" | "text";
|
|
363
709
|
operationType: "remove";
|
|
710
|
+
/**
|
|
711
|
+
* Alias of the canvas element to remove.
|
|
712
|
+
*/
|
|
364
713
|
alias: string;
|
|
714
|
+
/**
|
|
715
|
+
* Optional transition effect applied while the element disappears.
|
|
716
|
+
*/
|
|
365
717
|
transition?: PixiVNJsonMediaTransiotions;
|
|
366
718
|
};
|
|
719
|
+
/**
|
|
720
|
+
* Pauses or resumes playback of a video sprite on the canvas.
|
|
721
|
+
*/
|
|
367
722
|
type PixiVNJsonVideoPauseResume = {
|
|
368
723
|
type: "video";
|
|
369
724
|
operationType: "pause" | "resume";
|
|
725
|
+
/**
|
|
726
|
+
* Alias of the video element to pause or resume.
|
|
727
|
+
*/
|
|
370
728
|
alias: string;
|
|
371
729
|
};
|
|
730
|
+
/**
|
|
731
|
+
* Loads or lazy-loads asset bundles or individual assets into memory.
|
|
732
|
+
*/
|
|
372
733
|
type PixiVNJsonAssetsLoad = {
|
|
373
734
|
type: "assets" | "bundle";
|
|
374
735
|
operationType: "load" | "lazyload";
|
|
736
|
+
/**
|
|
737
|
+
* List of asset aliases (or bundle names) to load.
|
|
738
|
+
*/
|
|
375
739
|
aliases: string[];
|
|
376
740
|
};
|
|
377
741
|
type PixiVNJsonCanvasShow = PixiVNJsonCanvasImageContainerShow | PixiVNJsonCanvasImageVideoShow | PixiVNJsonCanvasTextShow;
|
|
742
|
+
/**
|
|
743
|
+
* Union of all canvas-element edit operations.
|
|
744
|
+
*/
|
|
378
745
|
type PixiVNJsonCanvasEdit = PixiVNJsonImageEdit | PixiVNJsonVideoEdit | PixiVNJsonImageContainerEdit | PixiVNJsonTextEdit | PixiVNJsonUnknownEdit<ImageSpriteMemory | VideoSpriteMemory | ContainerMemory | TextMemory>;
|
|
746
|
+
/**
|
|
747
|
+
* Union of all canvas operations — show, edit, remove, animate, apply effects, and asset loading.
|
|
748
|
+
*/
|
|
379
749
|
type PixiVNJsonCanvas = PixiVNJsonCanvasShow | PixiVNJsonCanvasEdit | PixiVNJsonCanvasRemove | PixiVNJsonVideoPauseResume | PixiVNJsonAssetsLoad | PixiVNJsonCanvasAnimate | PixiVNJsonCanvasEffect;
|
|
380
750
|
|
|
751
|
+
/**
|
|
752
|
+
* Requests user input during the narrative.
|
|
753
|
+
* When this operation is encountered, the engine pauses and waits for the player to provide a value.
|
|
754
|
+
*/
|
|
381
755
|
type PixiVNJsonInputRequest = {
|
|
382
756
|
type: "input";
|
|
383
757
|
operationType: "request";
|
|
758
|
+
/**
|
|
759
|
+
* The expected value type for the input (e.g. `"string"`, `"number"`, `"boolean"`).
|
|
760
|
+
* Used by the engine to validate or cast the player's answer.
|
|
761
|
+
*/
|
|
384
762
|
valueType?: string;
|
|
763
|
+
/**
|
|
764
|
+
* A default value that will be used if the player does not provide any input.
|
|
765
|
+
*/
|
|
385
766
|
defaultValue?: any;
|
|
386
767
|
};
|
|
768
|
+
/**
|
|
769
|
+
* Clears (resets) the current dialogue state.
|
|
770
|
+
* This is typically used to wipe any displayed text before showing new content.
|
|
771
|
+
*/
|
|
387
772
|
type PixiVNJsonDialogue = {
|
|
388
773
|
type: "dialogue";
|
|
389
774
|
operationType: "clean";
|
|
390
775
|
};
|
|
776
|
+
/**
|
|
777
|
+
* Narration operation — either a dialogue clear or a user-input request.
|
|
778
|
+
*/
|
|
391
779
|
type PixiVNJsonNarration = PixiVNJsonDialogue | PixiVNJsonInputRequest;
|
|
392
780
|
|
|
781
|
+
/**
|
|
782
|
+
* Starts playback of a sound asset.
|
|
783
|
+
*/
|
|
393
784
|
type PixiVNJsonSoundPlay = {
|
|
394
785
|
type: "sound";
|
|
395
786
|
operationType: "play";
|
|
787
|
+
/**
|
|
788
|
+
* Unique identifier (alias) used to reference this sound.
|
|
789
|
+
*/
|
|
396
790
|
alias: string;
|
|
791
|
+
/**
|
|
792
|
+
* URL of the sound file. If omitted, the alias is used as the URL.
|
|
793
|
+
*/
|
|
397
794
|
url?: string;
|
|
795
|
+
/**
|
|
796
|
+
* Playback options such as volume, loop, channel, and start offset.
|
|
797
|
+
*/
|
|
398
798
|
props?: SoundPlayOptionsWithChannel;
|
|
399
799
|
};
|
|
800
|
+
/**
|
|
801
|
+
* Stops a playing sound and removes it from the audio context.
|
|
802
|
+
*/
|
|
400
803
|
type PixiVNJsonSoundRemove = {
|
|
401
804
|
type: "sound";
|
|
402
805
|
operationType: "stop";
|
|
806
|
+
/**
|
|
807
|
+
* Alias of the sound to stop.
|
|
808
|
+
*/
|
|
403
809
|
alias: string;
|
|
404
810
|
};
|
|
811
|
+
/**
|
|
812
|
+
* Pauses or resumes a sound, a channel, or all audio.
|
|
813
|
+
*/
|
|
405
814
|
type PixiVNJsonSoundPauseResume = {
|
|
406
815
|
type: "sound" | "channel";
|
|
407
816
|
operationType: "pause" | "resume";
|
|
817
|
+
/**
|
|
818
|
+
* Alias of the sound or channel to pause/resume.
|
|
819
|
+
*/
|
|
408
820
|
alias: string;
|
|
409
821
|
} | {
|
|
410
822
|
type: "all";
|
|
411
823
|
operationType: "pause" | "resume" | "stop";
|
|
412
824
|
};
|
|
825
|
+
/**
|
|
826
|
+
* Edits the properties of a currently playing sound (volume, speed, muted, loop, etc.).
|
|
827
|
+
*/
|
|
413
828
|
type PixiVNJsonSoundEdit = {
|
|
414
829
|
type: "sound";
|
|
415
830
|
operationType: "edit";
|
|
831
|
+
/**
|
|
832
|
+
* Alias of the sound to edit.
|
|
833
|
+
*/
|
|
416
834
|
alias: string;
|
|
835
|
+
/**
|
|
836
|
+
* Partial set of properties to apply to the sound.
|
|
837
|
+
*/
|
|
417
838
|
props: Partial<Pick<MediaInterface, "speed" | "muted" | "loop" | "paused"> & Pick<SoundPlayOptionsWithChannel, "volume">>;
|
|
418
839
|
};
|
|
840
|
+
/**
|
|
841
|
+
* Union of all sound operations — play, stop, pause/resume, and edit.
|
|
842
|
+
*/
|
|
419
843
|
type PixiVNJsonSound = PixiVNJsonSoundPlay | PixiVNJsonSoundRemove | PixiVNJsonSoundPauseResume | PixiVNJsonSoundEdit;
|
|
420
844
|
|
|
845
|
+
/**
|
|
846
|
+
* An operation string that holds a list of string/value fragments to be concatenated at runtime.
|
|
847
|
+
* Used internally to represent string interpolation expressions before they are fully resolved.
|
|
848
|
+
*/
|
|
421
849
|
type PixiVNJsonOperationString = {
|
|
422
850
|
type: "operationtoconvert";
|
|
851
|
+
/**
|
|
852
|
+
* The ordered list of string fragments and/or value-get expressions to concatenate.
|
|
853
|
+
*/
|
|
423
854
|
values: (string | PixiVNJsonValueGet | PixiVNJsonConditionalStatements<string | PixiVNJsonValueGet>)[];
|
|
424
855
|
};
|
|
425
|
-
|
|
856
|
+
/**
|
|
857
|
+
* A single resolved operation — a value set, canvas operation, sound operation,
|
|
858
|
+
* narration operation, or function call — optionally annotated with an origin string.
|
|
859
|
+
*/
|
|
860
|
+
type PixiVNJsonOperation = (PixiVNJsonValueSet | PixiVNJsonCanvas | PixiVNJsonSound | PixiVNJsonNarration | PixiVNJsonFunction) & {
|
|
426
861
|
/**
|
|
427
862
|
* This value is used by the system to know where this operation is from, for example, if is generated from a string operation.
|
|
428
863
|
*/
|
|
429
864
|
$origin?: string;
|
|
430
865
|
};
|
|
866
|
+
/**
|
|
867
|
+
* A conditional operation — either a plain operation, an if-else that resolves to one,
|
|
868
|
+
* or an operation-string (string interpolation expression).
|
|
869
|
+
*/
|
|
431
870
|
type PixiVNJsonConditionalOperation = PixiVNJsonOperation | PixiVNJsonIfElse<PixiVNJsonOperation> | PixiVNJsonOperationString;
|
|
432
871
|
|
|
872
|
+
/**
|
|
873
|
+
* A player-presentable choice in a menu.
|
|
874
|
+
*/
|
|
433
875
|
type PixiVNJsonChoice = {
|
|
434
876
|
/**
|
|
435
877
|
* The text to be displayed.
|
|
@@ -460,8 +902,20 @@ type PixiVNJsonChoice = {
|
|
|
460
902
|
*/
|
|
461
903
|
autoSelect?: boolean;
|
|
462
904
|
};
|
|
905
|
+
/**
|
|
906
|
+
* A list of choices (possibly conditional) that are shown to the player as a menu.
|
|
907
|
+
*/
|
|
463
908
|
type PixiVNJsonChoices = (PixiVNJsonChoice | PixiVNJsonConditionalStatements<PixiVNJsonChoice>)[];
|
|
909
|
+
/**
|
|
910
|
+
* The text content of a dialogue line.
|
|
911
|
+
* Can be a plain string, a dynamic value-get, a conditional expression, or an array of any of these
|
|
912
|
+
* (which will be concatenated into a single string at runtime).
|
|
913
|
+
*/
|
|
464
914
|
type PixiVNJsonDialogText = string | PixiVNJsonValueGet | PixiVNJsonConditionalStatements<string | PixiVNJsonValueGet | string[]> | (string | PixiVNJsonValueGet | PixiVNJsonConditionalStatements<string | PixiVNJsonValueGet | string[]>)[];
|
|
915
|
+
/**
|
|
916
|
+
* A dialogue line, optionally attributed to a character.
|
|
917
|
+
* When a plain `Text` value is used, no character attribution is included.
|
|
918
|
+
*/
|
|
465
919
|
type PixiVNJsonDialog<Text = string> = {
|
|
466
920
|
/**
|
|
467
921
|
* The character id that will speak.
|
|
@@ -472,6 +926,9 @@ type PixiVNJsonDialog<Text = string> = {
|
|
|
472
926
|
*/
|
|
473
927
|
text: Text;
|
|
474
928
|
} | Text;
|
|
929
|
+
/**
|
|
930
|
+
* Describes a label that should be opened (called or jumped to) during a step.
|
|
931
|
+
*/
|
|
475
932
|
type PixiVNJsonLabelToOpen<T extends {} = object> = {
|
|
476
933
|
/**
|
|
477
934
|
* The id of the label to open.
|
|
@@ -501,6 +958,9 @@ type PixiVNJsonLabelToOpen<T extends {} = object> = {
|
|
|
501
958
|
* 5. end the label if {@link PixiVNJsonLabelStep.end} is "label_end"
|
|
502
959
|
*/
|
|
503
960
|
type PixiVNJsonLabelStep = {
|
|
961
|
+
/**
|
|
962
|
+
* Operations to execute at the start of this step (storage writes, canvas updates, sound, etc.).
|
|
963
|
+
*/
|
|
504
964
|
operations?: PixiVNJsonConditionalOperation[];
|
|
505
965
|
/**
|
|
506
966
|
* Variable used to display a choice menu.
|
|
@@ -529,69 +989,11 @@ type PixiVNJsonLabelStep = {
|
|
|
529
989
|
* - label_end: ends the label
|
|
530
990
|
*/
|
|
531
991
|
end?: "game_end" | "label_end" | PixiVNJsonConditionalStatements<"game_end" | "label_end">;
|
|
532
|
-
conditionalStep?: PixiVNJsonConditionalStatements<PixiVNJsonLabelStep | PixiVNJsonLabelStep[]>;
|
|
533
|
-
};
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
* Collection of labels to be used in the narrative.
|
|
537
|
-
*/
|
|
538
|
-
type PixiVNJsonLabels = {
|
|
539
|
-
[labelId: string]: PixiVNJsonLabelStep[];
|
|
540
|
-
};
|
|
541
|
-
|
|
542
|
-
/**
|
|
543
|
-
* PixiVNJson It can be defined as a programming language to write a narrative written in json.
|
|
544
|
-
*/
|
|
545
|
-
interface PixiVNJson {
|
|
546
|
-
/**
|
|
547
|
-
* The operations to be executed before the narrative starts.
|
|
548
|
-
* For the set storage: They will be set only if there are no variables with the same key already.
|
|
549
|
-
* For the det tempstorage: if there are variables with the same key already, they will be overwritten.
|
|
550
|
-
*/
|
|
551
|
-
initialOperations?: (PixiVNJsonValueSet | PixiVNJsonIfElse<PixiVNJsonValueSet>)[];
|
|
552
|
-
/**
|
|
553
|
-
* The labels to be used in the narrative. They will be added to the system
|
|
554
|
-
*/
|
|
555
|
-
labels?: PixiVNJsonLabels;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
type LabelJsonOptions = {
|
|
559
992
|
/**
|
|
560
|
-
*
|
|
561
|
-
*
|
|
993
|
+
* If set, this step is replaced by the result of evaluating the given conditional statement.
|
|
994
|
+
* Allows an entire step to be chosen at runtime based on a condition or step-switch strategy.
|
|
562
995
|
*/
|
|
563
|
-
|
|
564
|
-
/**
|
|
565
|
-
* If true and a dialog is empty or has only spaces, {@link PixiVNJsonLabelStep.goNextStep} will be set to true.
|
|
566
|
-
*/
|
|
567
|
-
skipEmptyDialogs?: boolean;
|
|
996
|
+
conditionalStep?: PixiVNJsonConditionalStatements<PixiVNJsonLabelStep | PixiVNJsonLabelStep[]>;
|
|
568
997
|
};
|
|
569
|
-
declare class LabelJson<T extends {} = object> extends LabelAbstract<LabelJson<T>, T> {
|
|
570
|
-
/**
|
|
571
|
-
* @param id is the id of the label
|
|
572
|
-
* @param steps is the list of steps that the label will perform
|
|
573
|
-
* @param props is the properties of the label
|
|
574
|
-
*/
|
|
575
|
-
constructor(id: string, steps: (PixiVNJsonLabelStep | (() => PixiVNJsonLabelStep))[], props?: LabelProps<LabelJson<T>>, options?: LabelJsonOptions);
|
|
576
|
-
private _steps;
|
|
577
|
-
get steps(): StepLabelType<T>[];
|
|
578
|
-
get stepCount(): number;
|
|
579
|
-
getStepById(stepId: number): StepLabelType<T> | undefined;
|
|
580
|
-
private operationStringConvert?;
|
|
581
|
-
private skipEmptyDialogs;
|
|
582
|
-
getStepSha(index: number): string | undefined;
|
|
583
|
-
private getDialogueText;
|
|
584
|
-
private getDialogue;
|
|
585
|
-
private getChoices;
|
|
586
|
-
private stepConverter;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
/**
|
|
590
|
-
* Import a Pixi'VN JSON to the system.
|
|
591
|
-
* This feature was created to give other developers the ability to create tools that can generate Pixi'VN labels or that generate Pixi'VN after extracting information from a programming language designed for writing narratives.
|
|
592
|
-
* @param values The Pixi'VN JSON to be imported
|
|
593
|
-
* @returns
|
|
594
|
-
*/
|
|
595
|
-
declare function importPixiVNJson(values: PixiVNJson | string | (PixiVNJson | string)[], options?: LabelJsonOptions): Promise<void>;
|
|
596
998
|
|
|
597
|
-
export {
|
|
999
|
+
export type { PixiVNJsonLabelStep as P, PixiVNJsonValueSet as a, PixiVNJsonIfElse as b, PixiVNJsonOperation as c, PixiVNJsonOperationString as d, PixiVNJsonCanvasAnimate as e, PixiVNJsonUnknownEdit as f, PixiVNJsonCanvasRemove as g, PixiVNJsonCanvasEffect as h, PixiVNJsonCanvasImageContainerShow as i, PixiVNJsonImageContainerEdit as j, PixiVNJsonCanvasImageVideoShow as k, PixiVNJsonImageEdit as l, PixiVNJsonCanvasTextShow as m, PixiVNJsonTextEdit as n, PixiVNJsonVideoEdit as o, PixiVNJsonVideoPauseResume as p, PixiVNJsonNarration as q, PixiVNJsonSound as r, PixiVNJsonValueGet as s, PixiVNJsonArithmeticOperations as t, PixiVNJsonConditions as u, PixiVNJsonFunction as v, PixiVNJsonConditionalStatements as w, PixiVNJsonConditionalResultToCombine as x, PixiVNJsonOnlyStorageSet as y };
|