@drincs/pixi-vn 0.3.3 → 0.3.4

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
@@ -82,11 +82,29 @@ declare class StoredClassModel {
82
82
  getStorageProperty<T>(propertyName: string): T | undefined;
83
83
  }
84
84
 
85
+ /**
86
+ * CharacterBaseModelProps is an interface that is used to create a character model.
87
+ */
85
88
  interface CharacterBaseModelProps {
89
+ /**
90
+ * The name of the character.
91
+ */
86
92
  name: string;
93
+ /**
94
+ * The surname of the character.
95
+ */
87
96
  surname?: string;
97
+ /**
98
+ * The age of the character.
99
+ */
88
100
  age?: number;
101
+ /**
102
+ * The icon of the character.
103
+ */
89
104
  icon?: string;
105
+ /**
106
+ * The color of the character.
107
+ */
90
108
  color?: string;
91
109
  }
92
110
  /**
@@ -113,19 +131,41 @@ interface CharacterBaseModelProps {
113
131
  * ```
114
132
  */
115
133
  declare class CharacterBaseModel extends StoredClassModel implements CharacterBaseModelProps {
134
+ /**
135
+ * @param id The id of the character.
136
+ * @param props The properties of the character.
137
+ */
116
138
  constructor(id: string, props: CharacterBaseModelProps);
117
139
  private defaultName;
140
+ /***
141
+ * The name of the character.
142
+ * If you set undefined, it will return the default name.
143
+ */
118
144
  get name(): string;
119
- set name(value: string);
145
+ set name(value: string | undefined);
120
146
  private defaultSurname?;
147
+ /**
148
+ * The surname of the character.
149
+ * If you set undefined, it will return the default surname.
150
+ */
121
151
  get surname(): string | undefined;
122
152
  set surname(value: string | undefined);
123
153
  private defaultAge?;
154
+ /**
155
+ * The age of the character.
156
+ * If you set undefined, it will return the default age.
157
+ */
124
158
  get age(): number | undefined;
125
159
  set age(value: number | undefined);
126
160
  private _icon?;
161
+ /**
162
+ * The icon of the character.
163
+ */
127
164
  get icon(): string | undefined;
128
165
  private _color?;
166
+ /**
167
+ * The color of the character.
168
+ */
129
169
  get color(): string | undefined;
130
170
  }
131
171
 
@@ -229,24 +269,43 @@ interface IStoratedChoiceMenuOptionLabel {
229
269
  }
230
270
 
231
271
  /**
232
- * Base class for all dialogue models. I suggest you extend this class to create your own dialogue models.
272
+ * Munu is a type that contains a list of Label that a player can choose from.
273
+ * For Ren'py this is the equivalent of a menu.
274
+ */
275
+ type ChoiceMenuOptionsType = ChoiceMenuOptionLabel[];
276
+
277
+ declare const PauseValueType = "Pause";
278
+ type PauseType = {
279
+ type: typeof PauseValueType;
280
+ duration: number;
281
+ };
282
+ declare function Pause(duration: number): PauseType;
283
+
284
+ type RepeatType = "Repeat";
285
+ declare const Repeat: RepeatType;
286
+
287
+ /**
288
+ * StorageElementType are all the types that can be stored in the storage
289
+ */
290
+ type StorageElementType = string | number | boolean | object | undefined | null;
291
+
292
+ /**
293
+ * Base class for all dialogue models.
294
+ * You can extend this class, but it is not reccomended. You can use the oltherParams property to store any other data you need.
233
295
  * @example
234
296
  * ```typescript
235
- * export class DialogueModel extends DialogueBaseModel {
236
- * constructor(
237
- * character: CharacterBaseModel | string,
238
- * text: string,
239
- * emotion: string
240
- * ) {
241
- * super(character, text);
242
- * this.emotion = emotion;
243
- * }
244
- * emotion = ""
245
- * }
297
+ * setDialogue(new DialogueBaseModel("Hello World", character))
246
298
  * ```
247
299
  */
248
300
  declare class DialogueBaseModel<TCharacter extends CharacterBaseModel = CharacterBaseModel> {
249
- constructor(text: string, character: string | TCharacter | undefined);
301
+ /**
302
+ * @param text The text of the dialogue.
303
+ * @param character The id of the character that is speaking.
304
+ * @param oltherParams Other parameters that can be stored in the dialogue.
305
+ */
306
+ constructor(text: string, character: string | TCharacter | undefined, oltherParams?: {
307
+ [key: string]: StorageElementType;
308
+ });
250
309
  /**
251
310
  * The text of the dialogue.
252
311
  */
@@ -255,6 +314,12 @@ declare class DialogueBaseModel<TCharacter extends CharacterBaseModel = Characte
255
314
  * The id of the character that is speaking.
256
315
  */
257
316
  characterId?: string;
317
+ /**
318
+ * Other parameters that can be stored in the dialogue.
319
+ */
320
+ oltherParams: {
321
+ [key: string]: StorageElementType;
322
+ };
258
323
  }
259
324
 
260
325
  /**
@@ -552,11 +617,6 @@ interface ITicker<TArgs extends TickerArgsType> {
552
617
  priority?: UPDATE_PRIORITY;
553
618
  }
554
619
 
555
- /**
556
- * StorageElementType are all the types that can be stored in the storage
557
- */
558
- type StorageElementType = string | number | boolean | object | undefined | null;
559
-
560
620
  type TickerArgsType = {
561
621
  [id: string]: StorageElementType;
562
622
  };
@@ -592,6 +652,11 @@ type TickerArgsType = {
592
652
  * ```
593
653
  */
594
654
  declare class TickerBase<TArgs extends TickerArgsType> implements ITicker<TArgs> {
655
+ /**
656
+ * @param args The arguments that you want to pass to the ticker.
657
+ * @param duration The duration of the ticker. If is undefined, the ticker will be called every frame.
658
+ * @param priority The priority of the ticker. If is undefined, the priority will be UPDATE_PRIORITY.NORMAL.
659
+ */
595
660
  constructor(args: TArgs, duration?: number, priority?: UPDATE_PRIORITY);
596
661
  args: TArgs;
597
662
  duration?: number;
@@ -907,16 +972,6 @@ interface ISaveData {
907
972
  path: string;
908
973
  }
909
974
 
910
- declare const PauseValueType = "Pause";
911
- type PauseType = {
912
- type: typeof PauseValueType;
913
- duration: number;
914
- };
915
- declare function Pause(duration: number): PauseType;
916
-
917
- type RepeatType = "Repeat";
918
- declare const Repeat: RepeatType;
919
-
920
975
  interface ITickersStep<TArgs extends TickerArgsType> extends ITicker<TArgs> {
921
976
  /**
922
977
  * Ticker class name
@@ -941,12 +996,6 @@ interface ITickersSteps {
941
996
  steps: (ITickersStep<any> | RepeatType | PauseType)[];
942
997
  }
943
998
 
944
- /**
945
- * Munu is a type that contains a list of Label that a player can choose from.
946
- * For Ren'py this is the equivalent of a menu.
947
- */
948
- type ChoiceMenuOptionsType = ChoiceMenuOptionLabel[];
949
-
950
999
  /**
951
1000
  * Set the dialogue to be shown in the game
952
1001
  * @param text Text of the dialogue
package/dist/index.d.ts CHANGED
@@ -82,11 +82,29 @@ declare class StoredClassModel {
82
82
  getStorageProperty<T>(propertyName: string): T | undefined;
83
83
  }
84
84
 
85
+ /**
86
+ * CharacterBaseModelProps is an interface that is used to create a character model.
87
+ */
85
88
  interface CharacterBaseModelProps {
89
+ /**
90
+ * The name of the character.
91
+ */
86
92
  name: string;
93
+ /**
94
+ * The surname of the character.
95
+ */
87
96
  surname?: string;
97
+ /**
98
+ * The age of the character.
99
+ */
88
100
  age?: number;
101
+ /**
102
+ * The icon of the character.
103
+ */
89
104
  icon?: string;
105
+ /**
106
+ * The color of the character.
107
+ */
90
108
  color?: string;
91
109
  }
92
110
  /**
@@ -113,19 +131,41 @@ interface CharacterBaseModelProps {
113
131
  * ```
114
132
  */
115
133
  declare class CharacterBaseModel extends StoredClassModel implements CharacterBaseModelProps {
134
+ /**
135
+ * @param id The id of the character.
136
+ * @param props The properties of the character.
137
+ */
116
138
  constructor(id: string, props: CharacterBaseModelProps);
117
139
  private defaultName;
140
+ /***
141
+ * The name of the character.
142
+ * If you set undefined, it will return the default name.
143
+ */
118
144
  get name(): string;
119
- set name(value: string);
145
+ set name(value: string | undefined);
120
146
  private defaultSurname?;
147
+ /**
148
+ * The surname of the character.
149
+ * If you set undefined, it will return the default surname.
150
+ */
121
151
  get surname(): string | undefined;
122
152
  set surname(value: string | undefined);
123
153
  private defaultAge?;
154
+ /**
155
+ * The age of the character.
156
+ * If you set undefined, it will return the default age.
157
+ */
124
158
  get age(): number | undefined;
125
159
  set age(value: number | undefined);
126
160
  private _icon?;
161
+ /**
162
+ * The icon of the character.
163
+ */
127
164
  get icon(): string | undefined;
128
165
  private _color?;
166
+ /**
167
+ * The color of the character.
168
+ */
129
169
  get color(): string | undefined;
130
170
  }
131
171
 
@@ -229,24 +269,43 @@ interface IStoratedChoiceMenuOptionLabel {
229
269
  }
230
270
 
231
271
  /**
232
- * Base class for all dialogue models. I suggest you extend this class to create your own dialogue models.
272
+ * Munu is a type that contains a list of Label that a player can choose from.
273
+ * For Ren'py this is the equivalent of a menu.
274
+ */
275
+ type ChoiceMenuOptionsType = ChoiceMenuOptionLabel[];
276
+
277
+ declare const PauseValueType = "Pause";
278
+ type PauseType = {
279
+ type: typeof PauseValueType;
280
+ duration: number;
281
+ };
282
+ declare function Pause(duration: number): PauseType;
283
+
284
+ type RepeatType = "Repeat";
285
+ declare const Repeat: RepeatType;
286
+
287
+ /**
288
+ * StorageElementType are all the types that can be stored in the storage
289
+ */
290
+ type StorageElementType = string | number | boolean | object | undefined | null;
291
+
292
+ /**
293
+ * Base class for all dialogue models.
294
+ * You can extend this class, but it is not reccomended. You can use the oltherParams property to store any other data you need.
233
295
  * @example
234
296
  * ```typescript
235
- * export class DialogueModel extends DialogueBaseModel {
236
- * constructor(
237
- * character: CharacterBaseModel | string,
238
- * text: string,
239
- * emotion: string
240
- * ) {
241
- * super(character, text);
242
- * this.emotion = emotion;
243
- * }
244
- * emotion = ""
245
- * }
297
+ * setDialogue(new DialogueBaseModel("Hello World", character))
246
298
  * ```
247
299
  */
248
300
  declare class DialogueBaseModel<TCharacter extends CharacterBaseModel = CharacterBaseModel> {
249
- constructor(text: string, character: string | TCharacter | undefined);
301
+ /**
302
+ * @param text The text of the dialogue.
303
+ * @param character The id of the character that is speaking.
304
+ * @param oltherParams Other parameters that can be stored in the dialogue.
305
+ */
306
+ constructor(text: string, character: string | TCharacter | undefined, oltherParams?: {
307
+ [key: string]: StorageElementType;
308
+ });
250
309
  /**
251
310
  * The text of the dialogue.
252
311
  */
@@ -255,6 +314,12 @@ declare class DialogueBaseModel<TCharacter extends CharacterBaseModel = Characte
255
314
  * The id of the character that is speaking.
256
315
  */
257
316
  characterId?: string;
317
+ /**
318
+ * Other parameters that can be stored in the dialogue.
319
+ */
320
+ oltherParams: {
321
+ [key: string]: StorageElementType;
322
+ };
258
323
  }
259
324
 
260
325
  /**
@@ -552,11 +617,6 @@ interface ITicker<TArgs extends TickerArgsType> {
552
617
  priority?: UPDATE_PRIORITY;
553
618
  }
554
619
 
555
- /**
556
- * StorageElementType are all the types that can be stored in the storage
557
- */
558
- type StorageElementType = string | number | boolean | object | undefined | null;
559
-
560
620
  type TickerArgsType = {
561
621
  [id: string]: StorageElementType;
562
622
  };
@@ -592,6 +652,11 @@ type TickerArgsType = {
592
652
  * ```
593
653
  */
594
654
  declare class TickerBase<TArgs extends TickerArgsType> implements ITicker<TArgs> {
655
+ /**
656
+ * @param args The arguments that you want to pass to the ticker.
657
+ * @param duration The duration of the ticker. If is undefined, the ticker will be called every frame.
658
+ * @param priority The priority of the ticker. If is undefined, the priority will be UPDATE_PRIORITY.NORMAL.
659
+ */
595
660
  constructor(args: TArgs, duration?: number, priority?: UPDATE_PRIORITY);
596
661
  args: TArgs;
597
662
  duration?: number;
@@ -907,16 +972,6 @@ interface ISaveData {
907
972
  path: string;
908
973
  }
909
974
 
910
- declare const PauseValueType = "Pause";
911
- type PauseType = {
912
- type: typeof PauseValueType;
913
- duration: number;
914
- };
915
- declare function Pause(duration: number): PauseType;
916
-
917
- type RepeatType = "Repeat";
918
- declare const Repeat: RepeatType;
919
-
920
975
  interface ITickersStep<TArgs extends TickerArgsType> extends ITicker<TArgs> {
921
976
  /**
922
977
  * Ticker class name
@@ -941,12 +996,6 @@ interface ITickersSteps {
941
996
  steps: (ITickersStep<any> | RepeatType | PauseType)[];
942
997
  }
943
998
 
944
- /**
945
- * Munu is a type that contains a list of Label that a player can choose from.
946
- * For Ren'py this is the equivalent of a menu.
947
- */
948
- type ChoiceMenuOptionsType = ChoiceMenuOptionLabel[];
949
-
950
999
  /**
951
1000
  * Set the dialogue to be shown in the game
952
1001
  * @param text Text of the dialogue
package/dist/index.js CHANGED
@@ -802,6 +802,11 @@ function setMemoryText(element, memory) {
802
802
 
803
803
  // src/classes/ticker/TickerBase.ts
804
804
  var TickerBase = class {
805
+ /**
806
+ * @param args The arguments that you want to pass to the ticker.
807
+ * @param duration The duration of the ticker. If is undefined, the ticker will be called every frame.
808
+ * @param priority The priority of the ticker. If is undefined, the priority will be UPDATE_PRIORITY.NORMAL.
809
+ */
805
810
  constructor(args, duration, priority) {
806
811
  this.args = args;
807
812
  this.duration = duration;
@@ -2377,6 +2382,10 @@ var StoredClassModel = class {
2377
2382
 
2378
2383
  // src/classes/CharacterBaseModel.ts
2379
2384
  var CharacterBaseModel2 = class extends StoredClassModel {
2385
+ /**
2386
+ * @param id The id of the character.
2387
+ * @param props The properties of the character.
2388
+ */
2380
2389
  constructor(id, props) {
2381
2390
  super(GameStorageManager.keysSystem.CHARACTER_CATEGORY_KEY, id);
2382
2391
  this.defaultName = "";
@@ -2386,27 +2395,45 @@ var CharacterBaseModel2 = class extends StoredClassModel {
2386
2395
  this._icon = props.icon;
2387
2396
  this._color = props.color;
2388
2397
  }
2398
+ /***
2399
+ * The name of the character.
2400
+ * If you set undefined, it will return the default name.
2401
+ */
2389
2402
  get name() {
2390
2403
  return this.getStorageProperty("name") || this.defaultName;
2391
2404
  }
2392
2405
  set name(value) {
2393
2406
  this.setStorageProperty("name", value);
2394
2407
  }
2408
+ /**
2409
+ * The surname of the character.
2410
+ * If you set undefined, it will return the default surname.
2411
+ */
2395
2412
  get surname() {
2396
2413
  return this.getStorageProperty("surname") || this.defaultSurname;
2397
2414
  }
2398
2415
  set surname(value) {
2399
2416
  this.setStorageProperty("surname", value);
2400
2417
  }
2418
+ /**
2419
+ * The age of the character.
2420
+ * If you set undefined, it will return the default age.
2421
+ */
2401
2422
  get age() {
2402
2423
  return this.getStorageProperty("age") || this.defaultAge;
2403
2424
  }
2404
2425
  set age(value) {
2405
2426
  this.setStorageProperty("age", value);
2406
2427
  }
2428
+ /**
2429
+ * The icon of the character.
2430
+ */
2407
2431
  get icon() {
2408
2432
  return this._icon;
2409
2433
  }
2434
+ /**
2435
+ * The color of the character.
2436
+ */
2410
2437
  get color() {
2411
2438
  return this._color;
2412
2439
  }
@@ -2435,17 +2462,27 @@ var ChoiceMenuOptionLabel = class {
2435
2462
 
2436
2463
  // src/classes/DialogueBaseModel.ts
2437
2464
  var DialogueBaseModel = class {
2438
- constructor(text, character) {
2465
+ /**
2466
+ * @param text The text of the dialogue.
2467
+ * @param character The id of the character that is speaking.
2468
+ * @param oltherParams Other parameters that can be stored in the dialogue.
2469
+ */
2470
+ constructor(text, character, oltherParams = {}) {
2439
2471
  /**
2440
2472
  * The text of the dialogue.
2441
2473
  */
2442
2474
  this.text = "";
2475
+ /**
2476
+ * Other parameters that can be stored in the dialogue.
2477
+ */
2478
+ this.oltherParams = {};
2443
2479
  this.text = text;
2444
2480
  if (typeof character === "string") {
2445
2481
  this.characterId = character;
2446
2482
  } else {
2447
2483
  this.characterId = character == null ? void 0 : character.id;
2448
2484
  }
2485
+ this.oltherParams = oltherParams;
2449
2486
  }
2450
2487
  };
2451
2488