@drincs/pixi-vn 0.4.6 → 0.4.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/dist/index.d.mts CHANGED
@@ -192,20 +192,38 @@ type LabelIdType = string;
192
192
  type StepHistoryDataType = string;
193
193
 
194
194
  /**
195
- * StepLabel is a function that will be executed as the game continues.
195
+ * StepLabelPropsType is the type of the props that will be passed to the StepLabel.
196
+ * You can override this interface to add your own props.
197
+ * @example
198
+ * ```typescript
199
+ * declare module '@drincs/pixi-vn/dist' {
200
+ * navigate: (route: string) => void
201
+ * }
202
+ * ```
196
203
  */
197
- type StepLabelType = (() => StepLabelResultType | Promise<StepLabelResultType>);
204
+ interface StepLabelProps {
205
+ [key: string]: any;
206
+ }
198
207
  /**
199
208
  * StepLabelResultType is the return type of the StepLabel function.
200
209
  * It can be useful for returning to the information calling function to perform other operations that cannot be performed within the StepLabel.
210
+ * You can override this interface to add your own return types.
211
+ * @example
212
+ * ```typescript
213
+ * declare module '@drincs/pixi-vn/dist' {
214
+ * newRoute: string
215
+ * }
216
+ * ```
201
217
  */
202
- type StepLabelResultType = {
203
- /**
204
- * The new route to navigate to.
205
- */
206
- newRoute?: string;
218
+ interface StepLabelResult {
207
219
  [key: string]: any;
208
- } | void;
220
+ }
221
+ type StepLabelResultType = StepLabelResult | void;
222
+ type StepLabelPropsType = StepLabelProps;
223
+ /**
224
+ * StepLabel is a function that will be executed as the game continues.
225
+ */
226
+ type StepLabelType = ((props: StepLabelPropsType) => StepLabelResultType | Promise<StepLabelResultType>);
209
227
 
210
228
  /**
211
229
  * Label is a class that contains a list of steps, which will be performed as the game continues.
@@ -548,7 +566,7 @@ declare class CanvasSprite<Memory extends SpriteOptions & ICanvasBaseMemory = IC
548
566
  * This class is a extension of the CanvasSprite class, it has the same properties and methods,
549
567
  * but it has some features that make texture management easier.
550
568
  * You need to use CanvasImage.load() to show the image in the canvas.
551
- * This class is used for functions like addImage, loadImages and showImageWithDissolveTransition.
569
+ * This class is used for functions like addImage, loadImages and showWithDissolveTransition.
552
570
  * @example
553
571
  * ```typescript
554
572
  * let alien = new CanvasImage({
@@ -1203,13 +1221,13 @@ declare function removeCanvasElement(tag: string | string[]): void;
1203
1221
  * Disolve effect is a effect that the image is shown with a fade in.
1204
1222
  * If exist a image with the same tag, then the image is replaced. And the first image is removed after the effect is done.
1205
1223
  * @param tag The unique tag of the image. You can use this tag to refer to this image
1206
- * @param imageUrl The url of the image.
1224
+ * @param image The imageUrl or the canvas element
1207
1225
  * @param args The arguments of the effect
1208
1226
  * @param duration The duration of the effect
1209
1227
  * @param priority The priority of the effect
1210
1228
  * @returns The sprite of the image.
1211
1229
  */
1212
- declare function showImageWithDissolveTransition(tag: string, imageUrl: string, speed: number, priority?: UPDATE_PRIORITY): Promise<void>;
1230
+ declare function showWithDissolveTransition<T extends CanvasBase<any> | string = string>(tag: string, image: T, speed: number, priority?: UPDATE_PRIORITY): Promise<void>;
1213
1231
 
1214
1232
  /**
1215
1233
  * Get the save data
@@ -1342,12 +1360,13 @@ declare class GameStepManager {
1342
1360
  private static increaseCurrentStepIndex;
1343
1361
  /**
1344
1362
  * Execute the next step and add it to the history.
1363
+ * @param props The props to pass to the step.
1345
1364
  * @returns StepLabelResultType or undefined.
1346
1365
  * @example
1347
1366
  * ```typescript
1348
1367
  * function nextOnClick() {
1349
1368
  * setLoading(true)
1350
- * GameStepManager.runNextStep()
1369
+ * GameStepManager.runNextStep(yourParams)
1351
1370
  * .then((result) => {
1352
1371
  * setUpdate((p) => p + 1)
1353
1372
  * setLoading(false)
@@ -1362,9 +1381,10 @@ declare class GameStepManager {
1362
1381
  * }
1363
1382
  * ```
1364
1383
  */
1365
- static runNextStep(): Promise<StepLabelResultType>;
1384
+ static runNextStep(props: StepLabelPropsType): Promise<StepLabelResultType>;
1366
1385
  /**
1367
1386
  * Execute the current step and add it to the history.
1387
+ * @param props The props to pass to the step.
1368
1388
  * @returns StepLabelResultType or undefined.
1369
1389
  */
1370
1390
  private static runCurrentStep;
@@ -1372,10 +1392,11 @@ declare class GameStepManager {
1372
1392
  * Execute the label and add it to the history.
1373
1393
  * Is a call function in Ren'Py.
1374
1394
  * @param label The label to execute.
1395
+ * @param props The props to pass to the label.
1375
1396
  * @returns StepLabelResultType or undefined.
1376
1397
  * @example
1377
1398
  * ```typescript
1378
- * GameStepManager.callLabel(StartLabel).then((result) => {
1399
+ * GameStepManager.callLabel(StartLabel, yourParams).then((result) => {
1379
1400
  * if (result) {
1380
1401
  * // your code
1381
1402
  * }
@@ -1389,15 +1410,16 @@ declare class GameStepManager {
1389
1410
  * })
1390
1411
  * ```
1391
1412
  */
1392
- static callLabel(label: typeof Label | Label): Promise<StepLabelResultType>;
1413
+ static callLabel(label: typeof Label | Label, props: StepLabelPropsType): Promise<StepLabelResultType>;
1393
1414
  /**
1394
1415
  * Execute the label, close all labels and add them to the history.
1395
1416
  * Is a jump function in Ren'Py.
1396
1417
  * @param label The label to execute.
1418
+ * @param props The props to pass to the label.
1397
1419
  * @returns StepLabelResultType or undefined.
1398
1420
  * @example
1399
1421
  * ```typescript
1400
- * GameStepManager.jumpLabel(StartLabel).then((result) => {
1422
+ * GameStepManager.jumpLabel(StartLabel, yourParams).then((result) => {
1401
1423
  * if (result) {
1402
1424
  * // your code
1403
1425
  * }
@@ -1411,7 +1433,7 @@ declare class GameStepManager {
1411
1433
  * })
1412
1434
  * ```
1413
1435
  */
1414
- static jumpLabel(label: typeof Label | Label): Promise<StepLabelResultType>;
1436
+ static jumpLabel(label: typeof Label | Label, props: StepLabelPropsType): Promise<StepLabelResultType>;
1415
1437
  /**
1416
1438
  * Go back to the last step and add it to the history.
1417
1439
  * @param navigate The navigate function.
@@ -1749,4 +1771,4 @@ declare class GameWindowManager {
1749
1771
  static import(data: object): void;
1750
1772
  }
1751
1773
 
1752
- export { CanvasBase, CanvasContainer, CanvasEvent, type CanvasEventNamesType, CanvasImage, CanvasSprite, CanvasText, CharacterBaseModel, type CharacterBaseModelProps, ChoiceMenuOptionLabel, type ChoiceMenuOptionsType, DialogueBaseModel, type ExportedCanvas, type ExportedStep, type ExportedStorage, GameStepManager, GameStorageManager, GameWindowManager, type ICanvasBaseMemory, type ICanvasContainerMemory, type ICanvasImageMemory, type ICanvasSpriteBaseMemory, type ICanvasSpriteMemory, type ICanvasTextMemory as ICanvasTextTextMemory, type IClassWithArgsHistory, type IClassWithArgsHistoryForExport, type IDialogueHistory, type IHistoryStep, type IHistoryStepData, type IOpenedLabel, type ISaveData, type ITextureMemory, type ITicker, type ITickersSteps, Label, LabelRunModeEnum, Pause, type PauseType, PauseValueType, Repeat, type RepeatType, type StepLabelResultType, type StepLabelType, type StorageElementType, StoredClassModel, TickerBase, TickerFadeAlpha, type TickerFadeAlphaProps, TickerMove, type TickerProgrationType, TickerRotate, type TickerRotateProps, addImage, canvasElementDecorator, clearAllGameDatas, clearChoiceMenuOptions, clearDialogue, eventDecorator, getAllCharacters, getCharacterById, getChoiceMenuOptions, getDialogue, getDialogueHistory, getFlag, getSaveData, getSaveJson, getTexture, labelDecorator, loadImages, loadSaveData, loadSaveJson, removeCanvasElement, saveCharacter, setChoiceMenuOptions, setDialogue, setFlag, showImageWithDissolveTransition, tickerDecorator };
1774
+ export { CanvasBase, CanvasContainer, CanvasEvent, type CanvasEventNamesType, CanvasImage, CanvasSprite, CanvasText, CharacterBaseModel, type CharacterBaseModelProps, ChoiceMenuOptionLabel, type ChoiceMenuOptionsType, DialogueBaseModel, type ExportedCanvas, type ExportedStep, type ExportedStorage, GameStepManager, GameStorageManager, GameWindowManager, type ICanvasBaseMemory, type ICanvasContainerMemory, type ICanvasImageMemory, type ICanvasSpriteBaseMemory, type ICanvasSpriteMemory, type ICanvasTextMemory as ICanvasTextTextMemory, type IClassWithArgsHistory, type IClassWithArgsHistoryForExport, type IDialogueHistory, type IHistoryStep, type IHistoryStepData, type IOpenedLabel, type ISaveData, type ITextureMemory, type ITicker, type ITickersSteps, Label, LabelRunModeEnum, Pause, type PauseType, PauseValueType, Repeat, type RepeatType, type StepLabelProps, type StepLabelResult, type StepLabelType, type StorageElementType, StoredClassModel, TickerBase, TickerFadeAlpha, type TickerFadeAlphaProps, TickerMove, type TickerProgrationType, TickerRotate, type TickerRotateProps, addImage, canvasElementDecorator, clearAllGameDatas, clearChoiceMenuOptions, clearDialogue, eventDecorator, getAllCharacters, getCharacterById, getChoiceMenuOptions, getDialogue, getDialogueHistory, getFlag, getSaveData, getSaveJson, getTexture, labelDecorator, loadImages, loadSaveData, loadSaveJson, removeCanvasElement, saveCharacter, setChoiceMenuOptions, setDialogue, setFlag, showWithDissolveTransition, tickerDecorator };
package/dist/index.d.ts CHANGED
@@ -192,20 +192,38 @@ type LabelIdType = string;
192
192
  type StepHistoryDataType = string;
193
193
 
194
194
  /**
195
- * StepLabel is a function that will be executed as the game continues.
195
+ * StepLabelPropsType is the type of the props that will be passed to the StepLabel.
196
+ * You can override this interface to add your own props.
197
+ * @example
198
+ * ```typescript
199
+ * declare module '@drincs/pixi-vn/dist' {
200
+ * navigate: (route: string) => void
201
+ * }
202
+ * ```
196
203
  */
197
- type StepLabelType = (() => StepLabelResultType | Promise<StepLabelResultType>);
204
+ interface StepLabelProps {
205
+ [key: string]: any;
206
+ }
198
207
  /**
199
208
  * StepLabelResultType is the return type of the StepLabel function.
200
209
  * It can be useful for returning to the information calling function to perform other operations that cannot be performed within the StepLabel.
210
+ * You can override this interface to add your own return types.
211
+ * @example
212
+ * ```typescript
213
+ * declare module '@drincs/pixi-vn/dist' {
214
+ * newRoute: string
215
+ * }
216
+ * ```
201
217
  */
202
- type StepLabelResultType = {
203
- /**
204
- * The new route to navigate to.
205
- */
206
- newRoute?: string;
218
+ interface StepLabelResult {
207
219
  [key: string]: any;
208
- } | void;
220
+ }
221
+ type StepLabelResultType = StepLabelResult | void;
222
+ type StepLabelPropsType = StepLabelProps;
223
+ /**
224
+ * StepLabel is a function that will be executed as the game continues.
225
+ */
226
+ type StepLabelType = ((props: StepLabelPropsType) => StepLabelResultType | Promise<StepLabelResultType>);
209
227
 
210
228
  /**
211
229
  * Label is a class that contains a list of steps, which will be performed as the game continues.
@@ -548,7 +566,7 @@ declare class CanvasSprite<Memory extends SpriteOptions & ICanvasBaseMemory = IC
548
566
  * This class is a extension of the CanvasSprite class, it has the same properties and methods,
549
567
  * but it has some features that make texture management easier.
550
568
  * You need to use CanvasImage.load() to show the image in the canvas.
551
- * This class is used for functions like addImage, loadImages and showImageWithDissolveTransition.
569
+ * This class is used for functions like addImage, loadImages and showWithDissolveTransition.
552
570
  * @example
553
571
  * ```typescript
554
572
  * let alien = new CanvasImage({
@@ -1203,13 +1221,13 @@ declare function removeCanvasElement(tag: string | string[]): void;
1203
1221
  * Disolve effect is a effect that the image is shown with a fade in.
1204
1222
  * If exist a image with the same tag, then the image is replaced. And the first image is removed after the effect is done.
1205
1223
  * @param tag The unique tag of the image. You can use this tag to refer to this image
1206
- * @param imageUrl The url of the image.
1224
+ * @param image The imageUrl or the canvas element
1207
1225
  * @param args The arguments of the effect
1208
1226
  * @param duration The duration of the effect
1209
1227
  * @param priority The priority of the effect
1210
1228
  * @returns The sprite of the image.
1211
1229
  */
1212
- declare function showImageWithDissolveTransition(tag: string, imageUrl: string, speed: number, priority?: UPDATE_PRIORITY): Promise<void>;
1230
+ declare function showWithDissolveTransition<T extends CanvasBase<any> | string = string>(tag: string, image: T, speed: number, priority?: UPDATE_PRIORITY): Promise<void>;
1213
1231
 
1214
1232
  /**
1215
1233
  * Get the save data
@@ -1342,12 +1360,13 @@ declare class GameStepManager {
1342
1360
  private static increaseCurrentStepIndex;
1343
1361
  /**
1344
1362
  * Execute the next step and add it to the history.
1363
+ * @param props The props to pass to the step.
1345
1364
  * @returns StepLabelResultType or undefined.
1346
1365
  * @example
1347
1366
  * ```typescript
1348
1367
  * function nextOnClick() {
1349
1368
  * setLoading(true)
1350
- * GameStepManager.runNextStep()
1369
+ * GameStepManager.runNextStep(yourParams)
1351
1370
  * .then((result) => {
1352
1371
  * setUpdate((p) => p + 1)
1353
1372
  * setLoading(false)
@@ -1362,9 +1381,10 @@ declare class GameStepManager {
1362
1381
  * }
1363
1382
  * ```
1364
1383
  */
1365
- static runNextStep(): Promise<StepLabelResultType>;
1384
+ static runNextStep(props: StepLabelPropsType): Promise<StepLabelResultType>;
1366
1385
  /**
1367
1386
  * Execute the current step and add it to the history.
1387
+ * @param props The props to pass to the step.
1368
1388
  * @returns StepLabelResultType or undefined.
1369
1389
  */
1370
1390
  private static runCurrentStep;
@@ -1372,10 +1392,11 @@ declare class GameStepManager {
1372
1392
  * Execute the label and add it to the history.
1373
1393
  * Is a call function in Ren'Py.
1374
1394
  * @param label The label to execute.
1395
+ * @param props The props to pass to the label.
1375
1396
  * @returns StepLabelResultType or undefined.
1376
1397
  * @example
1377
1398
  * ```typescript
1378
- * GameStepManager.callLabel(StartLabel).then((result) => {
1399
+ * GameStepManager.callLabel(StartLabel, yourParams).then((result) => {
1379
1400
  * if (result) {
1380
1401
  * // your code
1381
1402
  * }
@@ -1389,15 +1410,16 @@ declare class GameStepManager {
1389
1410
  * })
1390
1411
  * ```
1391
1412
  */
1392
- static callLabel(label: typeof Label | Label): Promise<StepLabelResultType>;
1413
+ static callLabel(label: typeof Label | Label, props: StepLabelPropsType): Promise<StepLabelResultType>;
1393
1414
  /**
1394
1415
  * Execute the label, close all labels and add them to the history.
1395
1416
  * Is a jump function in Ren'Py.
1396
1417
  * @param label The label to execute.
1418
+ * @param props The props to pass to the label.
1397
1419
  * @returns StepLabelResultType or undefined.
1398
1420
  * @example
1399
1421
  * ```typescript
1400
- * GameStepManager.jumpLabel(StartLabel).then((result) => {
1422
+ * GameStepManager.jumpLabel(StartLabel, yourParams).then((result) => {
1401
1423
  * if (result) {
1402
1424
  * // your code
1403
1425
  * }
@@ -1411,7 +1433,7 @@ declare class GameStepManager {
1411
1433
  * })
1412
1434
  * ```
1413
1435
  */
1414
- static jumpLabel(label: typeof Label | Label): Promise<StepLabelResultType>;
1436
+ static jumpLabel(label: typeof Label | Label, props: StepLabelPropsType): Promise<StepLabelResultType>;
1415
1437
  /**
1416
1438
  * Go back to the last step and add it to the history.
1417
1439
  * @param navigate The navigate function.
@@ -1749,4 +1771,4 @@ declare class GameWindowManager {
1749
1771
  static import(data: object): void;
1750
1772
  }
1751
1773
 
1752
- export { CanvasBase, CanvasContainer, CanvasEvent, type CanvasEventNamesType, CanvasImage, CanvasSprite, CanvasText, CharacterBaseModel, type CharacterBaseModelProps, ChoiceMenuOptionLabel, type ChoiceMenuOptionsType, DialogueBaseModel, type ExportedCanvas, type ExportedStep, type ExportedStorage, GameStepManager, GameStorageManager, GameWindowManager, type ICanvasBaseMemory, type ICanvasContainerMemory, type ICanvasImageMemory, type ICanvasSpriteBaseMemory, type ICanvasSpriteMemory, type ICanvasTextMemory as ICanvasTextTextMemory, type IClassWithArgsHistory, type IClassWithArgsHistoryForExport, type IDialogueHistory, type IHistoryStep, type IHistoryStepData, type IOpenedLabel, type ISaveData, type ITextureMemory, type ITicker, type ITickersSteps, Label, LabelRunModeEnum, Pause, type PauseType, PauseValueType, Repeat, type RepeatType, type StepLabelResultType, type StepLabelType, type StorageElementType, StoredClassModel, TickerBase, TickerFadeAlpha, type TickerFadeAlphaProps, TickerMove, type TickerProgrationType, TickerRotate, type TickerRotateProps, addImage, canvasElementDecorator, clearAllGameDatas, clearChoiceMenuOptions, clearDialogue, eventDecorator, getAllCharacters, getCharacterById, getChoiceMenuOptions, getDialogue, getDialogueHistory, getFlag, getSaveData, getSaveJson, getTexture, labelDecorator, loadImages, loadSaveData, loadSaveJson, removeCanvasElement, saveCharacter, setChoiceMenuOptions, setDialogue, setFlag, showImageWithDissolveTransition, tickerDecorator };
1774
+ export { CanvasBase, CanvasContainer, CanvasEvent, type CanvasEventNamesType, CanvasImage, CanvasSprite, CanvasText, CharacterBaseModel, type CharacterBaseModelProps, ChoiceMenuOptionLabel, type ChoiceMenuOptionsType, DialogueBaseModel, type ExportedCanvas, type ExportedStep, type ExportedStorage, GameStepManager, GameStorageManager, GameWindowManager, type ICanvasBaseMemory, type ICanvasContainerMemory, type ICanvasImageMemory, type ICanvasSpriteBaseMemory, type ICanvasSpriteMemory, type ICanvasTextMemory as ICanvasTextTextMemory, type IClassWithArgsHistory, type IClassWithArgsHistoryForExport, type IDialogueHistory, type IHistoryStep, type IHistoryStepData, type IOpenedLabel, type ISaveData, type ITextureMemory, type ITicker, type ITickersSteps, Label, LabelRunModeEnum, Pause, type PauseType, PauseValueType, Repeat, type RepeatType, type StepLabelProps, type StepLabelResult, type StepLabelType, type StorageElementType, StoredClassModel, TickerBase, TickerFadeAlpha, type TickerFadeAlphaProps, TickerMove, type TickerProgrationType, TickerRotate, type TickerRotateProps, addImage, canvasElementDecorator, clearAllGameDatas, clearChoiceMenuOptions, clearDialogue, eventDecorator, getAllCharacters, getCharacterById, getChoiceMenuOptions, getDialogue, getDialogueHistory, getFlag, getSaveData, getSaveJson, getTexture, labelDecorator, loadImages, loadSaveData, loadSaveJson, removeCanvasElement, saveCharacter, setChoiceMenuOptions, setDialogue, setFlag, showWithDissolveTransition, tickerDecorator };
package/dist/index.js CHANGED
@@ -123,7 +123,7 @@ __export(src_exports, {
123
123
  setChoiceMenuOptions: () => setChoiceMenuOptions,
124
124
  setDialogue: () => setDialogue,
125
125
  setFlag: () => setFlag,
126
- showImageWithDissolveTransition: () => showImageWithDissolveTransition,
126
+ showWithDissolveTransition: () => showWithDissolveTransition,
127
127
  tickerDecorator: () => tickerDecorator
128
128
  });
129
129
  module.exports = __toCommonJS(src_exports);
@@ -1093,31 +1093,31 @@ function loadImages(canvasImages) {
1093
1093
  function removeCanvasElement(tag) {
1094
1094
  GameWindowManager.removeCanvasElement(tag);
1095
1095
  }
1096
- function showImageWithDissolveTransition(tag, imageUrl, speed, priority) {
1096
+ function showWithDissolveTransition(tag, image, speed, priority) {
1097
1097
  return __async(this, null, function* () {
1098
- if (!GameWindowManager.getCanvasElement(tag)) {
1099
- let image2 = addImage(tag, imageUrl);
1100
- image2.alpha = 0;
1101
- let effect2 = new TickerFadeAlpha({
1102
- speed,
1103
- type: "show",
1104
- startOnlyIfHaveTexture: true
1105
- }, 1e4, priority);
1106
- GameWindowManager.addTicker(tag, effect2);
1107
- return image2.load();
1108
- }
1109
- let specialTag = tag + "_temp_disolve";
1098
+ let specialTag = void 0;
1099
+ if (GameWindowManager.getCanvasElement(tag)) {
1100
+ specialTag = tag + "_temp_disolve";
1101
+ GameWindowManager.editTagCanvasElement(tag, specialTag);
1102
+ }
1103
+ let canvasElement;
1104
+ if (typeof image === "string") {
1105
+ canvasElement = addImage(tag, image);
1106
+ } else {
1107
+ canvasElement = image;
1108
+ }
1109
+ image.alpha = 0;
1110
1110
  let effect = new TickerFadeAlpha({
1111
1111
  speed,
1112
1112
  type: "show",
1113
1113
  tagToRemoveAfter: specialTag,
1114
1114
  startOnlyIfHaveTexture: true
1115
1115
  }, 1e4, priority);
1116
- GameWindowManager.editTagCanvasElement(tag, specialTag);
1117
- let image = addImage(tag, imageUrl);
1118
- image.alpha = 0;
1119
1116
  GameWindowManager.addTicker(tag, effect);
1120
- return image.load();
1117
+ if (canvasElement instanceof CanvasImage) {
1118
+ return canvasElement.load();
1119
+ }
1120
+ return;
1121
1121
  });
1122
1122
  }
1123
1123
 
@@ -2084,12 +2084,13 @@ var _GameStepManager = class _GameStepManager {
2084
2084
  /* Run Methods */
2085
2085
  /**
2086
2086
  * Execute the next step and add it to the history.
2087
+ * @param props The props to pass to the step.
2087
2088
  * @returns StepLabelResultType or undefined.
2088
2089
  * @example
2089
2090
  * ```typescript
2090
2091
  * function nextOnClick() {
2091
2092
  * setLoading(true)
2092
- * GameStepManager.runNextStep()
2093
+ * GameStepManager.runNextStep(yourParams)
2093
2094
  * .then((result) => {
2094
2095
  * setUpdate((p) => p + 1)
2095
2096
  * setLoading(false)
@@ -2104,21 +2105,22 @@ var _GameStepManager = class _GameStepManager {
2104
2105
  * }
2105
2106
  * ```
2106
2107
  */
2107
- static runNextStep() {
2108
+ static runNextStep(props) {
2108
2109
  return __async(this, null, function* () {
2109
2110
  if (_GameStepManager._openedLabels.length === 0) {
2110
2111
  console.warn("[Pixi'VN] There are no labels to run");
2111
2112
  return;
2112
2113
  }
2113
2114
  _GameStepManager.increaseCurrentStepIndex();
2114
- return yield _GameStepManager.runCurrentStep();
2115
+ return yield _GameStepManager.runCurrentStep(props);
2115
2116
  });
2116
2117
  }
2117
2118
  /**
2118
2119
  * Execute the current step and add it to the history.
2120
+ * @param props The props to pass to the step.
2119
2121
  * @returns StepLabelResultType or undefined.
2120
2122
  */
2121
- static runCurrentStep() {
2123
+ static runCurrentStep(props) {
2122
2124
  return __async(this, null, function* () {
2123
2125
  if (_GameStepManager.currentLabelId) {
2124
2126
  let lasteStepsLength = _GameStepManager.currentLabelStepIndex;
@@ -2134,12 +2136,12 @@ var _GameStepManager = class _GameStepManager {
2134
2136
  let n = currentLabel.steps.length;
2135
2137
  if (n > lasteStepsLength) {
2136
2138
  let nextStep = currentLabel.steps[lasteStepsLength];
2137
- let result = yield nextStep();
2139
+ let result = yield nextStep(props);
2138
2140
  _GameStepManager.addStepHistory(nextStep);
2139
2141
  return result;
2140
2142
  } else if (n === lasteStepsLength) {
2141
2143
  _GameStepManager.closeCurrentLabel();
2142
- return yield _GameStepManager.runNextStep();
2144
+ return yield _GameStepManager.runNextStep(props);
2143
2145
  } else {
2144
2146
  console.warn("[Pixi'VN] There are no steps to run");
2145
2147
  }
@@ -2150,10 +2152,11 @@ var _GameStepManager = class _GameStepManager {
2150
2152
  * Execute the label and add it to the history.
2151
2153
  * Is a call function in Ren'Py.
2152
2154
  * @param label The label to execute.
2155
+ * @param props The props to pass to the label.
2153
2156
  * @returns StepLabelResultType or undefined.
2154
2157
  * @example
2155
2158
  * ```typescript
2156
- * GameStepManager.callLabel(StartLabel).then((result) => {
2159
+ * GameStepManager.callLabel(StartLabel, yourParams).then((result) => {
2157
2160
  * if (result) {
2158
2161
  * // your code
2159
2162
  * }
@@ -2167,7 +2170,7 @@ var _GameStepManager = class _GameStepManager {
2167
2170
  * })
2168
2171
  * ```
2169
2172
  */
2170
- static callLabel(label) {
2173
+ static callLabel(label, props) {
2171
2174
  return __async(this, null, function* () {
2172
2175
  try {
2173
2176
  if (label instanceof Label) {
@@ -2179,17 +2182,18 @@ var _GameStepManager = class _GameStepManager {
2179
2182
  console.error("[Pixi'VN] Error calling label", e);
2180
2183
  return;
2181
2184
  }
2182
- return yield _GameStepManager.runCurrentStep();
2185
+ return yield _GameStepManager.runCurrentStep(props);
2183
2186
  });
2184
2187
  }
2185
2188
  /**
2186
2189
  * Execute the label, close all labels and add them to the history.
2187
2190
  * Is a jump function in Ren'Py.
2188
2191
  * @param label The label to execute.
2192
+ * @param props The props to pass to the label.
2189
2193
  * @returns StepLabelResultType or undefined.
2190
2194
  * @example
2191
2195
  * ```typescript
2192
- * GameStepManager.jumpLabel(StartLabel).then((result) => {
2196
+ * GameStepManager.jumpLabel(StartLabel, yourParams).then((result) => {
2193
2197
  * if (result) {
2194
2198
  * // your code
2195
2199
  * }
@@ -2203,7 +2207,7 @@ var _GameStepManager = class _GameStepManager {
2203
2207
  * })
2204
2208
  * ```
2205
2209
  */
2206
- static jumpLabel(label) {
2210
+ static jumpLabel(label, props) {
2207
2211
  return __async(this, null, function* () {
2208
2212
  _GameStepManager.closeAllLabels();
2209
2213
  try {
@@ -2216,7 +2220,7 @@ var _GameStepManager = class _GameStepManager {
2216
2220
  console.error("[Pixi'VN] Error jumping label", e);
2217
2221
  return;
2218
2222
  }
2219
- return yield _GameStepManager.runCurrentStep();
2223
+ return yield _GameStepManager.runCurrentStep(props);
2220
2224
  });
2221
2225
  }
2222
2226
  /* After Update Methods */
@@ -2669,7 +2673,7 @@ var Label = class {
2669
2673
  setChoiceMenuOptions,
2670
2674
  setDialogue,
2671
2675
  setFlag,
2672
- showImageWithDissolveTransition,
2676
+ showWithDissolveTransition,
2673
2677
  tickerDecorator
2674
2678
  });
2675
2679
  //# sourceMappingURL=index.js.map