@drincs/pixi-vn 1.8.3 → 1.8.5
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/dist/ContainerMemory-BjcfYRU7.d.cts +392 -0
- package/dist/ContainerMemory-BjcfYRU7.d.ts +392 -0
- package/dist/HistoryChoiceMenuOption-CEmjDDJH.d.cts +53 -0
- package/dist/HistoryChoiceMenuOption-CN7NkcxU.d.ts +53 -0
- package/dist/HistoryGameState-3ztYdv84.d.cts +12 -0
- package/dist/HistoryGameState-D4t2fY9x.d.ts +12 -0
- package/dist/HistoryStep-DtOryKAZ.d.cts +76 -0
- package/dist/HistoryStep-DtOryKAZ.d.ts +76 -0
- package/dist/OpenedLabel-DJby8qPc.d.ts +8 -0
- package/dist/OpenedLabel-t6PvSzaL.d.cts +8 -0
- package/dist/SoundManagerInterface-TgOPqm2L.d.cts +436 -0
- package/dist/SoundManagerInterface-TgOPqm2L.d.ts +436 -0
- package/dist/StepLabelType-CN97wZzm.d.cts +27 -0
- package/dist/StepLabelType-CN97wZzm.d.ts +27 -0
- package/dist/StorageGameState-BJy57o6K.d.ts +27 -0
- package/dist/StorageGameState-CtjNJpvE.d.cts +27 -0
- package/dist/{StoredClassModel-C9mQxPg-.d.cts → StoredClassModel-Bykjdn8S.d.cts} +1 -1
- package/dist/{StoredClassModel-upXPNQTp.d.ts → StoredClassModel-uMifeNzV.d.ts} +1 -1
- package/dist/canvas.cjs +2 -2
- package/dist/canvas.d.cts +54 -464
- package/dist/canvas.d.ts +54 -464
- package/dist/canvas.mjs +2 -2
- package/dist/characters.cjs +1 -1
- package/dist/characters.d.cts +5 -5
- package/dist/characters.d.ts +5 -5
- package/dist/characters.mjs +1 -1
- package/dist/chunk-3GXLF557.mjs +1 -0
- package/dist/chunk-F3AVLCQB.mjs +1 -0
- package/dist/{chunk-YCWXA3OR.mjs → chunk-PZ55RNCZ.mjs} +1 -1
- package/dist/chunk-UK6MT3QS.mjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +5 -114
- package/dist/core.d.ts +5 -114
- package/dist/core.mjs +1 -1
- package/dist/history.cjs +1 -1
- package/dist/history.d.cts +7 -11
- package/dist/history.d.ts +7 -11
- package/dist/history.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +20 -826
- package/dist/index.d.ts +20 -826
- package/dist/index.mjs +2 -2
- package/dist/motion.cjs +1 -1
- package/dist/motion.mjs +1 -1
- package/dist/narration.cjs +2 -2
- package/dist/narration.d.cts +57 -22
- package/dist/narration.d.ts +57 -22
- package/dist/narration.mjs +2 -2
- package/dist/pixi/index.d.cts +12 -0
- package/dist/sound.cjs +1 -1
- package/dist/sound.d.cts +4 -435
- package/dist/sound.d.ts +4 -435
- package/dist/sound.mjs +1 -1
- package/dist/storage.cjs +1 -1
- package/dist/storage.d.cts +4 -27
- package/dist/storage.d.ts +4 -27
- package/dist/storage.mjs +1 -1
- package/dist/vite-listener.d.cts +1 -1
- package/dist/vite-listener.d.ts +1 -1
- package/dist/vite-listener.mjs +1 -1
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +2 -6
- package/dist/HistoryChoiceMenuOption-CS41KG13.d.ts +0 -182
- package/dist/HistoryChoiceMenuOption-DdwePsOm.d.cts +0 -182
- package/dist/chunk-K7JIC2F2.mjs +0 -1
- package/dist/chunk-V34PMA2H.mjs +0 -1
- package/dist/chunk-Z4GZCINS.mjs +0 -1
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { UPDATE_PRIORITY, PointData, Container, ContainerOptions } from '@drincs/pixi-vn/pixi.js';
|
|
2
|
+
|
|
3
|
+
interface TickerArgs {
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
interface Ticker<TArgs extends TickerArgs> {
|
|
7
|
+
/**
|
|
8
|
+
* Arguments to pass to the ticker
|
|
9
|
+
*/
|
|
10
|
+
args: TArgs;
|
|
11
|
+
/**
|
|
12
|
+
* Duration in seconds to run the ticker
|
|
13
|
+
*/
|
|
14
|
+
duration?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Priority of the ticker
|
|
17
|
+
*/
|
|
18
|
+
priority?: UPDATE_PRIORITY;
|
|
19
|
+
/**
|
|
20
|
+
* Get the alias of the ticker class. This variable is used in the system to get the ticker class by id, {@link RegisteredTickers.getInstance}
|
|
21
|
+
*/
|
|
22
|
+
readonly alias: string;
|
|
23
|
+
/**
|
|
24
|
+
* The id of the ticker. Must be unique for each ticker instance.
|
|
25
|
+
*/
|
|
26
|
+
readonly id: string;
|
|
27
|
+
/**
|
|
28
|
+
* The aliases of the canvas elements that are connected to this ticker
|
|
29
|
+
*/
|
|
30
|
+
canvasElementAliases: string[];
|
|
31
|
+
/**
|
|
32
|
+
* Completes the animation and applies the final state.
|
|
33
|
+
*/
|
|
34
|
+
complete: (options?: {
|
|
35
|
+
ignoreTickerSteps?: boolean;
|
|
36
|
+
}) => Promise<void> | void;
|
|
37
|
+
/**
|
|
38
|
+
* Stops the animation at its current state, and prevents it from resuming when the animation is played again.
|
|
39
|
+
*/
|
|
40
|
+
stop: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* Starts the ticker. This will start the ticker and begin the animation.
|
|
43
|
+
*/
|
|
44
|
+
start: () => void;
|
|
45
|
+
/**
|
|
46
|
+
* Pauses the animation.
|
|
47
|
+
*/
|
|
48
|
+
pause: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* Plays the animation.
|
|
51
|
+
*/
|
|
52
|
+
play: () => void;
|
|
53
|
+
/**
|
|
54
|
+
* Checks if the ticker is paused.
|
|
55
|
+
* @returns true if the ticker is paused, false otherwise.
|
|
56
|
+
*/
|
|
57
|
+
readonly paused: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* TickerHistory is a class that contains the name of a class and the arguments that were used to create it.
|
|
62
|
+
*/
|
|
63
|
+
interface TickerInfo<TArgs extends TickerArgs> {
|
|
64
|
+
/**
|
|
65
|
+
* If this ticker was created by steps
|
|
66
|
+
*/
|
|
67
|
+
createdByTicketSteps?: {
|
|
68
|
+
canvasElementAlias: string;
|
|
69
|
+
id: string;
|
|
70
|
+
};
|
|
71
|
+
ticker: Ticker<TArgs>;
|
|
72
|
+
}
|
|
73
|
+
interface TickerHistory<TArgs extends TickerArgs> {
|
|
74
|
+
id: string;
|
|
75
|
+
args: TArgs;
|
|
76
|
+
/**
|
|
77
|
+
* The aliases of the canvas elements that are connected to this ticker
|
|
78
|
+
*/
|
|
79
|
+
canvasElementAliases: string[];
|
|
80
|
+
priority?: UPDATE_PRIORITY;
|
|
81
|
+
duration?: number;
|
|
82
|
+
paused?: boolean;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
type PauseType = {
|
|
86
|
+
/**
|
|
87
|
+
* The type of the value
|
|
88
|
+
*/
|
|
89
|
+
type: "pause";
|
|
90
|
+
/**
|
|
91
|
+
* Duration in seconds
|
|
92
|
+
*/
|
|
93
|
+
duration: number;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
type RepeatType = "repeat";
|
|
97
|
+
|
|
98
|
+
interface TickersStep<TArgs extends TickerArgs> {
|
|
99
|
+
/**
|
|
100
|
+
* Ticker class name
|
|
101
|
+
*/
|
|
102
|
+
ticker: string;
|
|
103
|
+
/**
|
|
104
|
+
* Duration in seconds. If is undefined, the step will end only when the animation is finished.
|
|
105
|
+
*/
|
|
106
|
+
duration?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Arguments to pass to the ticker
|
|
109
|
+
*/
|
|
110
|
+
args: TArgs;
|
|
111
|
+
/**
|
|
112
|
+
* Priority of the ticker
|
|
113
|
+
*/
|
|
114
|
+
priority?: UPDATE_PRIORITY;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The steps of the tickers
|
|
118
|
+
*/
|
|
119
|
+
interface TickersSequence {
|
|
120
|
+
/**
|
|
121
|
+
* The step number
|
|
122
|
+
*/
|
|
123
|
+
currentStepNumber: number;
|
|
124
|
+
/**
|
|
125
|
+
* The steps of the tickers
|
|
126
|
+
*/
|
|
127
|
+
steps: (TickersStep<any> | RepeatType | PauseType)[];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* This class is used to create a canvas element to add into a Pixi Application.
|
|
132
|
+
* You can use {@link canvas.add()} to add this element into the application.
|
|
133
|
+
* This class should be implemented and the memory method should be overridden.
|
|
134
|
+
* You must use the {@link canvasComponentDecorator} to register the canvas in the game.
|
|
135
|
+
* In Ren'Py is a displayable.
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* const CANVAS_EXAMPLE_ID = "CanvasExample";
|
|
139
|
+
*
|
|
140
|
+
* \@canvasComponentDecorator({
|
|
141
|
+
* name: CANVAS_EXAMPLE_ID,
|
|
142
|
+
* })
|
|
143
|
+
* export class CanvasExample extends Container implements CanvasBaseItem<Memory> {
|
|
144
|
+
* get memory(): Memory {
|
|
145
|
+
* return {
|
|
146
|
+
* pixivnId: CANVAS_EXAMPLE_ID,
|
|
147
|
+
* // ... other properties
|
|
148
|
+
* }
|
|
149
|
+
* }
|
|
150
|
+
* async setMemory(value: Memory) {
|
|
151
|
+
* // ... set other properties
|
|
152
|
+
* }
|
|
153
|
+
* }
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
declare class CanvasBaseItem<T2 extends CanvasBaseItemMemory> {
|
|
157
|
+
constructor(..._options: any);
|
|
158
|
+
/**
|
|
159
|
+
* This method return the memory of the canvas element.
|
|
160
|
+
* @throws {PixiError} when the method is not overridden in the subclass.
|
|
161
|
+
*/
|
|
162
|
+
get memory(): T2;
|
|
163
|
+
/**
|
|
164
|
+
* This method set the memory of the canvas element.
|
|
165
|
+
* @throws {PixiError} when the method is not overridden in the subclass.
|
|
166
|
+
*/
|
|
167
|
+
setMemory(_value: T2): Promise<void> | void;
|
|
168
|
+
/**
|
|
169
|
+
* Get the id of the canvas element. This variable is used in the system to get the canvas element by id
|
|
170
|
+
*/
|
|
171
|
+
pixivnId: string;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Interface for the canvas base memory
|
|
176
|
+
*/
|
|
177
|
+
interface CanvasBaseItemMemory {
|
|
178
|
+
pixivnId: string;
|
|
179
|
+
/**
|
|
180
|
+
* The index of the container in its parent, if it has one
|
|
181
|
+
*/
|
|
182
|
+
index?: number;
|
|
183
|
+
/**
|
|
184
|
+
* The label of the parent container, if it has one
|
|
185
|
+
*/
|
|
186
|
+
parentLabel?: string;
|
|
187
|
+
label?: string;
|
|
188
|
+
zIndex?: number;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Interface exported canvas
|
|
193
|
+
*/
|
|
194
|
+
interface CanvasGameState {
|
|
195
|
+
tickers: {
|
|
196
|
+
[id: string]: TickerHistory<any>;
|
|
197
|
+
};
|
|
198
|
+
tickersSteps: {
|
|
199
|
+
[alias: string]: {
|
|
200
|
+
[tickerId: string]: TickersSequence;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
elements: {
|
|
204
|
+
[alias: string]: CanvasBaseItemMemory;
|
|
205
|
+
};
|
|
206
|
+
stage: Partial<ContainerMemory>;
|
|
207
|
+
/**
|
|
208
|
+
* @deprecated
|
|
209
|
+
*/
|
|
210
|
+
elementAliasesOrder: string[];
|
|
211
|
+
tickersToCompleteOnStepEnd: {
|
|
212
|
+
tikersIds: {
|
|
213
|
+
id: string;
|
|
214
|
+
}[];
|
|
215
|
+
stepAlias: {
|
|
216
|
+
id: string;
|
|
217
|
+
alias: string;
|
|
218
|
+
}[];
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
interface AdditionalPositionsExtensionProps {
|
|
223
|
+
/**
|
|
224
|
+
* is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
|
|
225
|
+
* For example:
|
|
226
|
+
* - if you set align to 0.5, the element will be in the center of the canvas.
|
|
227
|
+
* - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
|
|
228
|
+
* - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
|
|
229
|
+
*
|
|
230
|
+
* **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
|
|
231
|
+
*/
|
|
232
|
+
align?: Partial<PointData> | number;
|
|
233
|
+
/**
|
|
234
|
+
* is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
|
|
235
|
+
* For example:
|
|
236
|
+
* - if you set align to 0.5, the element will be in the center of the canvas.
|
|
237
|
+
* - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
|
|
238
|
+
* - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
|
|
239
|
+
*
|
|
240
|
+
* **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
|
|
241
|
+
*/
|
|
242
|
+
xAlign?: number;
|
|
243
|
+
/**
|
|
244
|
+
* is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
|
|
245
|
+
* For example:
|
|
246
|
+
* - if you set align to 0.5, the element will be in the center of the canvas.
|
|
247
|
+
* - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
|
|
248
|
+
* - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
|
|
249
|
+
*
|
|
250
|
+
* **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
|
|
251
|
+
*/
|
|
252
|
+
yAlign?: number;
|
|
253
|
+
/**
|
|
254
|
+
* is a way to set the position of the element in the canvas calculated in percentage.
|
|
255
|
+
* For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
|
|
256
|
+
* - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
|
|
257
|
+
* - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
|
|
258
|
+
* - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
|
|
259
|
+
*
|
|
260
|
+
* **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
|
|
261
|
+
*/
|
|
262
|
+
percentagePosition?: Partial<PointData> | number;
|
|
263
|
+
/**
|
|
264
|
+
* is a way to set the position of the element in the canvas calculated in percentage.
|
|
265
|
+
* For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
|
|
266
|
+
* - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
|
|
267
|
+
* - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
|
|
268
|
+
* - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
|
|
269
|
+
*
|
|
270
|
+
* **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
|
|
271
|
+
*/
|
|
272
|
+
percentageX?: number;
|
|
273
|
+
/**
|
|
274
|
+
* is a way to set the position of the element in the canvas calculated in percentage.
|
|
275
|
+
* For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
|
|
276
|
+
* - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
|
|
277
|
+
* - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
|
|
278
|
+
* - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
|
|
279
|
+
*
|
|
280
|
+
* **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
|
|
281
|
+
*/
|
|
282
|
+
percentageY?: number;
|
|
283
|
+
}
|
|
284
|
+
interface AdditionalPositionsExtension {
|
|
285
|
+
/**
|
|
286
|
+
* is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
|
|
287
|
+
* For example:
|
|
288
|
+
* - if you set align to 0.5, the element will be in the center of the canvas.
|
|
289
|
+
* - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
|
|
290
|
+
* - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
|
|
291
|
+
*
|
|
292
|
+
* **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
|
|
293
|
+
*/
|
|
294
|
+
align: Partial<PointData> | number;
|
|
295
|
+
/**
|
|
296
|
+
* is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
|
|
297
|
+
* For example:
|
|
298
|
+
* - if you set align to 0.5, the element will be in the center of the canvas.
|
|
299
|
+
* - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
|
|
300
|
+
* - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
|
|
301
|
+
*
|
|
302
|
+
* **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
|
|
303
|
+
*/
|
|
304
|
+
xAlign: number;
|
|
305
|
+
/**
|
|
306
|
+
* is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
|
|
307
|
+
* For example:
|
|
308
|
+
* - if you set align to 0.5, the element will be in the center of the canvas.
|
|
309
|
+
* - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
|
|
310
|
+
* - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
|
|
311
|
+
*
|
|
312
|
+
* **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
|
|
313
|
+
*/
|
|
314
|
+
yAlign: number;
|
|
315
|
+
/**
|
|
316
|
+
* is a way to set the position of the element in the canvas calculated in percentage.
|
|
317
|
+
* For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
|
|
318
|
+
* - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
|
|
319
|
+
* - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
|
|
320
|
+
* - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
|
|
321
|
+
*
|
|
322
|
+
* **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
|
|
323
|
+
*/
|
|
324
|
+
percentagePosition: Partial<PointData> | number;
|
|
325
|
+
/**
|
|
326
|
+
* is a way to set the position of the element in the canvas calculated in percentage.
|
|
327
|
+
* For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
|
|
328
|
+
* - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
|
|
329
|
+
* - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
|
|
330
|
+
* - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
|
|
331
|
+
*
|
|
332
|
+
* **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
|
|
333
|
+
*/
|
|
334
|
+
percentageX: number;
|
|
335
|
+
/**
|
|
336
|
+
* is a way to set the position of the element in the canvas calculated in percentage.
|
|
337
|
+
* For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
|
|
338
|
+
* - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
|
|
339
|
+
* - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
|
|
340
|
+
* - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
|
|
341
|
+
*
|
|
342
|
+
* **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
|
|
343
|
+
*/
|
|
344
|
+
percentageY: number;
|
|
345
|
+
readonly positionType: "pixel" | "percentage" | "align";
|
|
346
|
+
readonly positionInfo: {
|
|
347
|
+
x: number;
|
|
348
|
+
y: number;
|
|
349
|
+
type: "pixel" | "percentage" | "align";
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
declare function analizePositionsExtensionProps<T extends AdditionalPositionsExtensionProps>(props?: T): T | undefined;
|
|
353
|
+
|
|
354
|
+
type ContainerChild = Container & CanvasBaseItem<any>;
|
|
355
|
+
|
|
356
|
+
interface ListenerExtensionMemory {
|
|
357
|
+
onEvents?: OnEventsHandlers;
|
|
358
|
+
}
|
|
359
|
+
interface OnEventsHandlers {
|
|
360
|
+
[name: string]: string;
|
|
361
|
+
}
|
|
362
|
+
interface ListenerExtension {
|
|
363
|
+
/**
|
|
364
|
+
* Add a listener for a given event.
|
|
365
|
+
* @example
|
|
366
|
+
* ```ts
|
|
367
|
+
* export class Events {
|
|
368
|
+
* \@eventDecorator()
|
|
369
|
+
* static eventExample(event: FederatedEvent, component: Sprite) {
|
|
370
|
+
* // event code here
|
|
371
|
+
* }
|
|
372
|
+
* }
|
|
373
|
+
*
|
|
374
|
+
* sprite.on("pointerdown", Events.eventExample);
|
|
375
|
+
* ```
|
|
376
|
+
*/
|
|
377
|
+
on: Container["on"];
|
|
378
|
+
readonly onEventsHandlers: OnEventsHandlers;
|
|
379
|
+
}
|
|
380
|
+
declare function addListenerHandler<T extends ListenerExtension>(event: symbol | string, element: T, fn: (...args: never[]) => unknown): boolean;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Interface for the canvas container memory
|
|
384
|
+
*/
|
|
385
|
+
interface ContainerMemory<C extends ContainerChild = ContainerChild> extends ContainerOptions<C>, CanvasBaseItemMemory, ListenerExtensionMemory, AdditionalPositionsExtensionProps {
|
|
386
|
+
/**
|
|
387
|
+
* The elements contained in this container
|
|
388
|
+
*/
|
|
389
|
+
elements: CanvasBaseItemMemory[];
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export { type AdditionalPositionsExtension as A, CanvasBaseItem as C, type ListenerExtension as L, type OnEventsHandlers as O, type PauseType as P, type RepeatType as R, type Ticker as T, type AdditionalPositionsExtensionProps as a, type CanvasBaseItemMemory as b, type CanvasGameState as c, type ContainerChild as d, type ContainerMemory as e, type ListenerExtensionMemory as f, type TickerArgs as g, type TickerHistory as h, type TickerInfo as i, type TickersSequence as j, addListenerHandler as k, analizePositionsExtensionProps as l };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { S as StorageElementType } from './StorageElementType-C7ETezlL.cjs';
|
|
2
|
+
import { D as DialogueInterface } from './HistoryStep-DtOryKAZ.cjs';
|
|
3
|
+
|
|
4
|
+
type CloseType = "close";
|
|
5
|
+
|
|
6
|
+
type LabelRunModeType = "call" | "jump";
|
|
7
|
+
|
|
8
|
+
interface NarrationHistory {
|
|
9
|
+
/**
|
|
10
|
+
* Dialogue to be shown in the game
|
|
11
|
+
*/
|
|
12
|
+
dialogue?: DialogueInterface;
|
|
13
|
+
/**
|
|
14
|
+
* List of choices asked of the player
|
|
15
|
+
*/
|
|
16
|
+
choices?: HistoryChoiceMenuOption[];
|
|
17
|
+
/**
|
|
18
|
+
* The player made a choice
|
|
19
|
+
*/
|
|
20
|
+
playerMadeChoice?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The index of the step in the history.
|
|
23
|
+
*/
|
|
24
|
+
stepIndex: number;
|
|
25
|
+
/**
|
|
26
|
+
* The input value of the player
|
|
27
|
+
*/
|
|
28
|
+
inputValue?: StorageElementType;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* HistoryChoiceMenuOption is a type that contains the history information of a choice menu option.
|
|
33
|
+
*/
|
|
34
|
+
type HistoryChoiceMenuOption = {
|
|
35
|
+
/**
|
|
36
|
+
* Text to be displayed in the menu
|
|
37
|
+
*/
|
|
38
|
+
text: string | string[];
|
|
39
|
+
/**
|
|
40
|
+
* Method used to open the label, or close the menu.
|
|
41
|
+
*/
|
|
42
|
+
type: CloseType | LabelRunModeType;
|
|
43
|
+
/**
|
|
44
|
+
* This choice is a response
|
|
45
|
+
*/
|
|
46
|
+
isResponse: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The choice is hidden
|
|
49
|
+
*/
|
|
50
|
+
hidden: boolean;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export type { CloseType as C, HistoryChoiceMenuOption as H, LabelRunModeType as L, NarrationHistory as N };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { S as StorageElementType } from './StorageElementType-C7ETezlL.js';
|
|
2
|
+
import { D as DialogueInterface } from './HistoryStep-DtOryKAZ.js';
|
|
3
|
+
|
|
4
|
+
type CloseType = "close";
|
|
5
|
+
|
|
6
|
+
type LabelRunModeType = "call" | "jump";
|
|
7
|
+
|
|
8
|
+
interface NarrationHistory {
|
|
9
|
+
/**
|
|
10
|
+
* Dialogue to be shown in the game
|
|
11
|
+
*/
|
|
12
|
+
dialogue?: DialogueInterface;
|
|
13
|
+
/**
|
|
14
|
+
* List of choices asked of the player
|
|
15
|
+
*/
|
|
16
|
+
choices?: HistoryChoiceMenuOption[];
|
|
17
|
+
/**
|
|
18
|
+
* The player made a choice
|
|
19
|
+
*/
|
|
20
|
+
playerMadeChoice?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The index of the step in the history.
|
|
23
|
+
*/
|
|
24
|
+
stepIndex: number;
|
|
25
|
+
/**
|
|
26
|
+
* The input value of the player
|
|
27
|
+
*/
|
|
28
|
+
inputValue?: StorageElementType;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* HistoryChoiceMenuOption is a type that contains the history information of a choice menu option.
|
|
33
|
+
*/
|
|
34
|
+
type HistoryChoiceMenuOption = {
|
|
35
|
+
/**
|
|
36
|
+
* Text to be displayed in the menu
|
|
37
|
+
*/
|
|
38
|
+
text: string | string[];
|
|
39
|
+
/**
|
|
40
|
+
* Method used to open the label, or close the menu.
|
|
41
|
+
*/
|
|
42
|
+
type: CloseType | LabelRunModeType;
|
|
43
|
+
/**
|
|
44
|
+
* This choice is a response
|
|
45
|
+
*/
|
|
46
|
+
isResponse: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The choice is hidden
|
|
49
|
+
*/
|
|
50
|
+
hidden: boolean;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export type { CloseType as C, HistoryChoiceMenuOption as H, LabelRunModeType as L, NarrationHistory as N };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GameStepState } from '@drincs/pixi-vn';
|
|
2
|
+
import { H as HistoryStep } from './HistoryStep-DtOryKAZ.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Interface exported step data
|
|
6
|
+
*/
|
|
7
|
+
interface HistoryGameState {
|
|
8
|
+
stepsHistory: HistoryStep[];
|
|
9
|
+
originalStepData: GameStepState | undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type { HistoryGameState as H };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GameStepState } from '@drincs/pixi-vn';
|
|
2
|
+
import { H as HistoryStep } from './HistoryStep-DtOryKAZ.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Interface exported step data
|
|
6
|
+
*/
|
|
7
|
+
interface HistoryGameState {
|
|
8
|
+
stepsHistory: HistoryStep[];
|
|
9
|
+
originalStepData: GameStepState | undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type { HistoryGameState as H };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Difference } from 'microdiff';
|
|
2
|
+
import { StoredChoiceInterface, StorageElementType, OpenedLabel } from '@drincs/pixi-vn/canvas';
|
|
3
|
+
import { CharacterInterface } from '@drincs/pixi-vn';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* is a string containing the name of the label.
|
|
7
|
+
* It is used to {@link narration.registeredLabels} to get the label class.
|
|
8
|
+
*/
|
|
9
|
+
type LabelIdType = string;
|
|
10
|
+
|
|
11
|
+
interface DialogueInterface {
|
|
12
|
+
/**
|
|
13
|
+
* The text of the dialogue.
|
|
14
|
+
*/
|
|
15
|
+
text: string | string[];
|
|
16
|
+
/**
|
|
17
|
+
* The id of the character that is speaking.
|
|
18
|
+
*/
|
|
19
|
+
character?: CharacterInterface | string;
|
|
20
|
+
}
|
|
21
|
+
type StoredDialogue = Omit<DialogueInterface, "character"> & {
|
|
22
|
+
character: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
interface HistoryStep {
|
|
26
|
+
/**
|
|
27
|
+
* The difference between the previous step and the current step.
|
|
28
|
+
*/
|
|
29
|
+
diff?: Difference[];
|
|
30
|
+
/**
|
|
31
|
+
* The label id of the current step.
|
|
32
|
+
*/
|
|
33
|
+
currentLabel?: LabelIdType;
|
|
34
|
+
/**
|
|
35
|
+
* The sha1 of the step function.
|
|
36
|
+
*/
|
|
37
|
+
stepSha1: string;
|
|
38
|
+
/**
|
|
39
|
+
* Equivalent to the narration.stepCounter
|
|
40
|
+
*/
|
|
41
|
+
index: number;
|
|
42
|
+
/**
|
|
43
|
+
* The data of the step of the label.
|
|
44
|
+
*/
|
|
45
|
+
labelStepIndex: number | null;
|
|
46
|
+
/**
|
|
47
|
+
* Dialogue to be shown in the game
|
|
48
|
+
*/
|
|
49
|
+
dialogue?: StoredDialogue;
|
|
50
|
+
/**
|
|
51
|
+
* List of choices asked of the player
|
|
52
|
+
*/
|
|
53
|
+
choices?: StoredChoiceInterface[];
|
|
54
|
+
/**
|
|
55
|
+
* List of choices already made by the player
|
|
56
|
+
*/
|
|
57
|
+
alreadyMadeChoices?: number[];
|
|
58
|
+
/**
|
|
59
|
+
* The input value of the player
|
|
60
|
+
*/
|
|
61
|
+
inputValue?: StorageElementType;
|
|
62
|
+
/**
|
|
63
|
+
* The choice made by the player
|
|
64
|
+
*/
|
|
65
|
+
choiceIndexMade?: number;
|
|
66
|
+
/**
|
|
67
|
+
* If true, the current dialogue will be glued to the previous one.
|
|
68
|
+
*/
|
|
69
|
+
isGlued?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Opened Labels in the current step.
|
|
72
|
+
*/
|
|
73
|
+
openedLabels?: OpenedLabel[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export type { DialogueInterface as D, HistoryStep as H, LabelIdType as L };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Difference } from 'microdiff';
|
|
2
|
+
import { StoredChoiceInterface, StorageElementType, OpenedLabel } from '@drincs/pixi-vn/canvas';
|
|
3
|
+
import { CharacterInterface } from '@drincs/pixi-vn';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* is a string containing the name of the label.
|
|
7
|
+
* It is used to {@link narration.registeredLabels} to get the label class.
|
|
8
|
+
*/
|
|
9
|
+
type LabelIdType = string;
|
|
10
|
+
|
|
11
|
+
interface DialogueInterface {
|
|
12
|
+
/**
|
|
13
|
+
* The text of the dialogue.
|
|
14
|
+
*/
|
|
15
|
+
text: string | string[];
|
|
16
|
+
/**
|
|
17
|
+
* The id of the character that is speaking.
|
|
18
|
+
*/
|
|
19
|
+
character?: CharacterInterface | string;
|
|
20
|
+
}
|
|
21
|
+
type StoredDialogue = Omit<DialogueInterface, "character"> & {
|
|
22
|
+
character: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
interface HistoryStep {
|
|
26
|
+
/**
|
|
27
|
+
* The difference between the previous step and the current step.
|
|
28
|
+
*/
|
|
29
|
+
diff?: Difference[];
|
|
30
|
+
/**
|
|
31
|
+
* The label id of the current step.
|
|
32
|
+
*/
|
|
33
|
+
currentLabel?: LabelIdType;
|
|
34
|
+
/**
|
|
35
|
+
* The sha1 of the step function.
|
|
36
|
+
*/
|
|
37
|
+
stepSha1: string;
|
|
38
|
+
/**
|
|
39
|
+
* Equivalent to the narration.stepCounter
|
|
40
|
+
*/
|
|
41
|
+
index: number;
|
|
42
|
+
/**
|
|
43
|
+
* The data of the step of the label.
|
|
44
|
+
*/
|
|
45
|
+
labelStepIndex: number | null;
|
|
46
|
+
/**
|
|
47
|
+
* Dialogue to be shown in the game
|
|
48
|
+
*/
|
|
49
|
+
dialogue?: StoredDialogue;
|
|
50
|
+
/**
|
|
51
|
+
* List of choices asked of the player
|
|
52
|
+
*/
|
|
53
|
+
choices?: StoredChoiceInterface[];
|
|
54
|
+
/**
|
|
55
|
+
* List of choices already made by the player
|
|
56
|
+
*/
|
|
57
|
+
alreadyMadeChoices?: number[];
|
|
58
|
+
/**
|
|
59
|
+
* The input value of the player
|
|
60
|
+
*/
|
|
61
|
+
inputValue?: StorageElementType;
|
|
62
|
+
/**
|
|
63
|
+
* The choice made by the player
|
|
64
|
+
*/
|
|
65
|
+
choiceIndexMade?: number;
|
|
66
|
+
/**
|
|
67
|
+
* If true, the current dialogue will be glued to the previous one.
|
|
68
|
+
*/
|
|
69
|
+
isGlued?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Opened Labels in the current step.
|
|
72
|
+
*/
|
|
73
|
+
openedLabels?: OpenedLabel[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export type { DialogueInterface as D, HistoryStep as H, LabelIdType as L };
|