@drincs/nqtr 0.1.5 → 0.1.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.
Files changed (100) hide show
  1. package/dist/classes/Activity.d.mts +10 -9
  2. package/dist/classes/Activity.d.ts +10 -9
  3. package/dist/classes/Activity.js +27 -13
  4. package/dist/classes/Activity.js.map +1 -1
  5. package/dist/classes/Activity.mjs +27 -13
  6. package/dist/classes/Activity.mjs.map +1 -1
  7. package/dist/classes/Commitment.d.mts +3 -2
  8. package/dist/classes/Commitment.d.ts +3 -2
  9. package/dist/classes/Commitment.js +11 -4
  10. package/dist/classes/Commitment.js.map +1 -1
  11. package/dist/classes/Commitment.mjs +11 -4
  12. package/dist/classes/Commitment.mjs.map +1 -1
  13. package/dist/classes/index.d.mts +3 -2
  14. package/dist/classes/index.d.ts +3 -2
  15. package/dist/classes/index.js +25 -11
  16. package/dist/classes/index.js.map +1 -1
  17. package/dist/classes/index.mjs +25 -11
  18. package/dist/classes/index.mjs.map +1 -1
  19. package/dist/classes/navigation/ActivityRoom.d.mts +3 -2
  20. package/dist/classes/navigation/ActivityRoom.d.ts +3 -2
  21. package/dist/classes/navigation/ActivityRoom.js +13 -6
  22. package/dist/classes/navigation/ActivityRoom.js.map +1 -1
  23. package/dist/classes/navigation/ActivityRoom.mjs +13 -6
  24. package/dist/classes/navigation/ActivityRoom.mjs.map +1 -1
  25. package/dist/classes/navigation/Location.d.mts +3 -2
  26. package/dist/classes/navigation/Location.d.ts +3 -2
  27. package/dist/classes/navigation/Location.js +11 -4
  28. package/dist/classes/navigation/Location.js.map +1 -1
  29. package/dist/classes/navigation/Location.mjs +11 -4
  30. package/dist/classes/navigation/Location.mjs.map +1 -1
  31. package/dist/classes/navigation/Map.d.mts +3 -2
  32. package/dist/classes/navigation/Map.d.ts +3 -2
  33. package/dist/classes/navigation/Map.js +11 -8
  34. package/dist/classes/navigation/Map.js.map +1 -1
  35. package/dist/classes/navigation/Map.mjs +11 -8
  36. package/dist/classes/navigation/Map.mjs.map +1 -1
  37. package/dist/classes/navigation/Room.d.mts +3 -2
  38. package/dist/classes/navigation/Room.d.ts +3 -2
  39. package/dist/classes/navigation/Room.js +37 -17
  40. package/dist/classes/navigation/Room.js.map +1 -1
  41. package/dist/classes/navigation/Room.mjs +37 -17
  42. package/dist/classes/navigation/Room.mjs.map +1 -1
  43. package/dist/classes/navigation/index.d.mts +3 -2
  44. package/dist/classes/navigation/index.d.ts +3 -2
  45. package/dist/classes/navigation/index.js +59 -29
  46. package/dist/classes/navigation/index.js.map +1 -1
  47. package/dist/classes/navigation/index.mjs +59 -29
  48. package/dist/classes/navigation/index.mjs.map +1 -1
  49. package/dist/decorators/ActivityDecorator.d.mts +2 -1
  50. package/dist/decorators/ActivityDecorator.d.ts +2 -1
  51. package/dist/decorators/CommitmentDecorator.d.mts +3 -2
  52. package/dist/decorators/CommitmentDecorator.d.ts +3 -2
  53. package/dist/decorators/RoomDecorator.d.mts +3 -2
  54. package/dist/decorators/RoomDecorator.d.ts +3 -2
  55. package/dist/decorators/index.d.mts +3 -2
  56. package/dist/decorators/index.d.ts +3 -2
  57. package/dist/functions/ActivityFunctions.d.mts +3 -2
  58. package/dist/functions/ActivityFunctions.d.ts +3 -2
  59. package/dist/functions/ActivityFunctions.js.map +1 -1
  60. package/dist/functions/ActivityFunctions.mjs.map +1 -1
  61. package/dist/functions/NavigationFunctions.d.mts +3 -2
  62. package/dist/functions/NavigationFunctions.d.ts +3 -2
  63. package/dist/functions/NavigationFunctions.js +11 -4
  64. package/dist/functions/NavigationFunctions.js.map +1 -1
  65. package/dist/functions/NavigationFunctions.mjs +11 -4
  66. package/dist/functions/NavigationFunctions.mjs.map +1 -1
  67. package/dist/functions/RoutineFunctions.d.mts +3 -2
  68. package/dist/functions/RoutineFunctions.d.ts +3 -2
  69. package/dist/functions/index.d.mts +3 -2
  70. package/dist/functions/index.d.ts +3 -2
  71. package/dist/functions/index.js +11 -4
  72. package/dist/functions/index.js.map +1 -1
  73. package/dist/functions/index.mjs +11 -4
  74. package/dist/functions/index.mjs.map +1 -1
  75. package/dist/{index-BvCfRbJB.d.mts → index-CwqgrVp6.d.mts} +30 -33
  76. package/dist/{index-Ci6Aw7YE.d.ts → index-D_4poX-_.d.ts} +30 -33
  77. package/dist/index.d.mts +3 -2
  78. package/dist/index.d.ts +3 -2
  79. package/dist/index.js +84 -40
  80. package/dist/index.js.map +1 -1
  81. package/dist/index.mjs +84 -40
  82. package/dist/index.mjs.map +1 -1
  83. package/dist/override/GraphicItemType.d.mts +16 -0
  84. package/dist/override/GraphicItemType.d.ts +16 -0
  85. package/dist/{types/GraphicItem.js → override/GraphicItemType.js} +1 -1
  86. package/dist/override/GraphicItemType.mjs +3 -0
  87. package/dist/override/OnRenderGraphicItemProps.d.mts +19 -0
  88. package/dist/override/OnRenderGraphicItemProps.d.ts +19 -0
  89. package/dist/override/OnRenderGraphicItemProps.js +4 -0
  90. package/dist/override/OnRenderGraphicItemProps.js.map +1 -0
  91. package/dist/override/OnRenderGraphicItemProps.mjs +3 -0
  92. package/dist/override/OnRenderGraphicItemProps.mjs.map +1 -0
  93. package/dist/override/index.d.mts +3 -0
  94. package/dist/override/index.d.ts +3 -0
  95. package/package.json +2 -2
  96. package/dist/types/GraphicItem.d.mts +0 -5
  97. package/dist/types/GraphicItem.d.ts +0 -5
  98. package/dist/types/GraphicItem.mjs +0 -3
  99. /package/dist/{types/GraphicItem.js.map → override/GraphicItemType.js.map} +0 -0
  100. /package/dist/{types/GraphicItem.mjs.map → override/GraphicItemType.mjs.map} +0 -0
@@ -1,9 +1,10 @@
1
1
  import ActivityModel, { ActivityStoredAbstract, OnRunActivityEvent, ActivityProps } from './classes/Activity.js';
2
2
  import { StoredClassModel, CharacterBaseModel } from '@drincs/pixi-vn';
3
3
  import { ExecutionTypeEnum } from './enums/ExecutionTypeEnum.js';
4
- import { GraphicItemType } from './types/GraphicItem.js';
4
+ import GraphicItemType from './override/GraphicItemType.js';
5
+ import OnRenderGraphicItemProps from './override/OnRenderGraphicItemProps.js';
5
6
 
6
- interface MapBaseModelProps<TMap extends MapBaseModel = MapBaseModel> {
7
+ interface MapBaseModelProps {
7
8
  /**
8
9
  * The name
9
10
  * @default ""
@@ -23,7 +24,7 @@ interface MapBaseModelProps<TMap extends MapBaseModel = MapBaseModel> {
23
24
  * ```
24
25
  * @default undefined
25
26
  */
26
- image?: GraphicItemType | Record<any, GraphicItemType> | object;
27
+ renderImage?: GraphicItemType | ((map: MapBaseModel, props?: OnRenderGraphicItemProps) => GraphicItemType);
27
28
  /**
28
29
  * The neighboring maps that are available in this map.
29
30
  * @example
@@ -80,13 +81,11 @@ declare class MapBaseModel extends StoredClassModel {
80
81
  */
81
82
  get name(): string;
82
83
  set name(value: string | undefined);
83
- private defaultImage?;
84
+ private _renderImage?;
84
85
  /**
85
- * The image of the map. It can be a string, an Element or a Pixi'VN Canvas Item.
86
- * If you set undefined, it will return the initial value of image.
86
+ * The function for rendering the image of the map.
87
87
  */
88
- get image(): GraphicItemType | Record<any, GraphicItemType> | object | undefined;
89
- set image(value: GraphicItemType | Record<any, GraphicItemType> | object | undefined);
88
+ get renderImage(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
90
89
  private defaultDisabled;
91
90
  /**
92
91
  * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
@@ -143,7 +142,7 @@ declare class ActivityRoom<TRoom extends RoomBaseModel = RoomBaseModel> extends
143
142
  }
144
143
 
145
144
  declare const ROOM_CATEGORY = "__nqtr-room__";
146
- interface RoomBaseModelProps {
145
+ interface RoomBaseModelProps<TLocation extends LocationBaseModel = LocationBaseModel> {
147
146
  /**
148
147
  * The name
149
148
  * @default ""
@@ -163,7 +162,7 @@ interface RoomBaseModelProps {
163
162
  * ```
164
163
  * @default undefined
165
164
  */
166
- image?: GraphicItemType | Record<any, GraphicItemType> | object;
165
+ renderImage?: GraphicItemType | ((room: RoomBaseModel<TLocation>, props?: OnRenderGraphicItemProps) => GraphicItemType);
167
166
  /**
168
167
  * The activities that are available in this room.
169
168
  * @default []
@@ -183,7 +182,7 @@ interface RoomBaseModelProps {
183
182
  * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
184
183
  * @default undefined
185
184
  */
186
- icon?: GraphicItemType;
185
+ renderIcon?: GraphicItemType | ((room: RoomBaseModel<TLocation>, props?: OnRenderGraphicItemProps) => GraphicItemType);
187
186
  /**
188
187
  * Whether is an entrance room, so when the player enters in the location, it will be the first room to be shown.
189
188
  * @default false
@@ -210,7 +209,7 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
210
209
  * @param location The location where the room is.
211
210
  * @param props The properties of the room.
212
211
  */
213
- constructor(id: string, location: TLocation, props?: RoomBaseModelProps);
212
+ constructor(id: string, location: TLocation, props?: RoomBaseModelProps<TLocation>);
214
213
  private _location;
215
214
  /**
216
215
  * The location where the room is.
@@ -228,13 +227,11 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
228
227
  */
229
228
  get name(): string;
230
229
  set name(value: string | undefined);
231
- private defaultImage?;
230
+ private _renderImage?;
232
231
  /**
233
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
234
- * If you set undefined, it will return the initial value of image.
232
+ * The function for rendering the image of the room.
235
233
  */
236
- get image(): GraphicItemType | Record<any, GraphicItemType> | object | undefined;
237
- set image(value: GraphicItemType | Record<any, GraphicItemType> | object | undefined);
234
+ get renderImage(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
238
235
  private defaultActivityIds;
239
236
  /**
240
237
  * The activities that are available in this room.
@@ -289,11 +286,11 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
289
286
  */
290
287
  get hidden(): boolean;
291
288
  set hidden(value: boolean | string);
289
+ private _renderIcon?;
292
290
  /**
293
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
291
+ * The function for rendering the icon of the room.
294
292
  */
295
- private _icon?;
296
- get icon(): GraphicItemType | undefined;
293
+ get renderIcon(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
297
294
  /**
298
295
  * Get the character commitments of the room.
299
296
  * @returns The character commitments of the room.
@@ -301,7 +298,7 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
301
298
  getRoutine<TCommitment extends CommitmentBaseModel = CommitmentBaseModel>(): TCommitment[];
302
299
  }
303
300
 
304
- interface LocationBaseModelProps {
301
+ interface LocationBaseModelProps<TMap extends MapBaseModel = MapBaseModel> {
305
302
  /**
306
303
  * The name
307
304
  * @default ""
@@ -321,7 +318,7 @@ interface LocationBaseModelProps {
321
318
  * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
322
319
  * @default undefined
323
320
  */
324
- icon?: GraphicItemType;
321
+ renderIcon?: GraphicItemType | ((location: LocationBaseModel<TMap>, props?: OnRenderGraphicItemProps) => GraphicItemType);
325
322
  }
326
323
  /**
327
324
  * The base model of a location. I suggest you extend this class to create your own location model.
@@ -339,7 +336,7 @@ declare class LocationBaseModel<TMap extends MapBaseModel = MapBaseModel> extend
339
336
  * @param map The map where the location is.
340
337
  * @param props The properties of the location.
341
338
  */
342
- constructor(id: string, map: TMap, props?: LocationBaseModelProps);
339
+ constructor(id: string, map: TMap, props?: LocationBaseModelProps<TMap>);
343
340
  private defaultName;
344
341
  /**
345
342
  * The name of the location.
@@ -359,11 +356,11 @@ declare class LocationBaseModel<TMap extends MapBaseModel = MapBaseModel> extend
359
356
  */
360
357
  get hidden(): boolean;
361
358
  set hidden(value: boolean | string);
362
- private _icon?;
359
+ private _renderIcon?;
363
360
  /**
364
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
361
+ * The function for rendering the icon of the location.
365
362
  */
366
- get icon(): GraphicItemType | undefined;
363
+ get renderIcon(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
367
364
  private _map;
368
365
  /**
369
366
  * The map where the location is.
@@ -391,7 +388,7 @@ declare class LocationBaseModel<TMap extends MapBaseModel = MapBaseModel> extend
391
388
  getRooms<TRoom extends RoomBaseModel = RoomBaseModel>(): TRoom[];
392
389
  }
393
390
 
394
- interface CommitmentBaseModelProps {
391
+ interface CommitmentBaseModelProps<TCharacter extends CharacterBaseModel = CharacterBaseModel, TRoom extends RoomBaseModel = RoomBaseModel> {
395
392
  /**
396
393
  * The name
397
394
  * @default ""
@@ -435,7 +432,7 @@ interface CommitmentBaseModelProps {
435
432
  * ```
436
433
  * @default undefined
437
434
  */
438
- image?: GraphicItemType | Record<any, GraphicItemType> | object;
435
+ renderImage?: GraphicItemType | ((commitment: CommitmentBaseModel<TCharacter, TRoom>, props?: OnRenderGraphicItemProps) => GraphicItemType);
439
436
  /**
440
437
  * Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
441
438
  * @default ExecutionTypeEnum.INTERACTION
@@ -483,7 +480,7 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
483
480
  * @param room The room where the commitment is.
484
481
  * @param props The properties of the commitment.
485
482
  */
486
- constructor(id: string, character: TCharacter | TCharacter[] | undefined, room: TRoom, props: CommitmentBaseModelProps);
483
+ constructor(id: string, character: TCharacter | TCharacter[] | undefined, room: TRoom, props: CommitmentBaseModelProps<TCharacter, TRoom>);
487
484
  private _characters;
488
485
  /**
489
486
  * The character or characters that are in the commitment and so in the room.
@@ -498,7 +495,7 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
498
495
  /**
499
496
  * The name
500
497
  */
501
- get name(): GraphicItemType;
498
+ get name(): string;
502
499
  private defaultFromHour?;
503
500
  /**
504
501
  * The hour when the commitment starts. If the commitment is not started yet, it will be hidden.
@@ -527,11 +524,11 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
527
524
  */
528
525
  get toDay(): number | undefined;
529
526
  set toDay(value: number | undefined);
530
- private _image?;
527
+ private _renderImage?;
531
528
  /**
532
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
529
+ * The function for rendering the image of the room.
533
530
  */
534
- get image(): GraphicItemType | Record<any, GraphicItemType> | object | undefined;
531
+ get renderImage(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
535
532
  private _executionType;
536
533
  /**
537
534
  * Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { default as ActivityModel, ActivityProps } from './classes/Activity.mjs';
2
- export { C as CommitmentBaseModel, a as CommitmentBaseModelProps, L as LocationBaseModel, b as LocationBaseModelProps, M as MapBaseModel, c as MapBaseModelProps, R as RoomBaseModel, d as RoomBaseModelProps } from './index-BvCfRbJB.mjs';
2
+ export { C as CommitmentBaseModel, a as CommitmentBaseModelProps, L as LocationBaseModel, b as LocationBaseModelProps, M as MapBaseModel, c as MapBaseModelProps, R as RoomBaseModel, d as RoomBaseModelProps } from './index-CwqgrVp6.mjs';
3
3
  export { default as Goal, GoalProps } from './classes/quest/Goal.mjs';
4
4
  export { Q as QuestBaseModel, a as QuestBaseModelProps, c as QuestsRequiredType, S as StageBaseModel, b as StageBaseModelProps } from './index-gJ26gdgL.mjs';
5
5
  export { getActivityById, saveActivity } from './decorators/ActivityDecorator.mjs';
@@ -12,5 +12,6 @@ export { clearExpiredRoutine, getCommitmentByCharacter, getCurrentCommitments }
12
12
  export { default as TimeManager } from './managers/TimeManager.mjs';
13
13
  export { ITimeStlot, TimeSettings } from './types/TimeSettings.mjs';
14
14
  import '@drincs/nqtr/dist/override';
15
- import './types/GraphicItem.mjs';
15
+ import './override/GraphicItemType.mjs';
16
16
  import '@drincs/pixi-vn';
17
+ import './override/OnRenderGraphicItemProps.mjs';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { default as ActivityModel, ActivityProps } from './classes/Activity.js';
2
- export { C as CommitmentBaseModel, a as CommitmentBaseModelProps, L as LocationBaseModel, b as LocationBaseModelProps, M as MapBaseModel, c as MapBaseModelProps, R as RoomBaseModel, d as RoomBaseModelProps } from './index-Ci6Aw7YE.js';
2
+ export { C as CommitmentBaseModel, a as CommitmentBaseModelProps, L as LocationBaseModel, b as LocationBaseModelProps, M as MapBaseModel, c as MapBaseModelProps, R as RoomBaseModel, d as RoomBaseModelProps } from './index-D_4poX-_.js';
3
3
  export { default as Goal, GoalProps } from './classes/quest/Goal.js';
4
4
  export { Q as QuestBaseModel, a as QuestBaseModelProps, c as QuestsRequiredType, S as StageBaseModel, b as StageBaseModelProps } from './index-BjOzVDyw.js';
5
5
  export { getActivityById, saveActivity } from './decorators/ActivityDecorator.js';
@@ -12,5 +12,6 @@ export { clearExpiredRoutine, getCommitmentByCharacter, getCurrentCommitments }
12
12
  export { default as TimeManager } from './managers/TimeManager.js';
13
13
  export { ITimeStlot, TimeSettings } from './types/TimeSettings.js';
14
14
  import '@drincs/nqtr/dist/override';
15
- import './types/GraphicItem.js';
15
+ import './override/GraphicItemType.js';
16
16
  import '@drincs/pixi-vn';
17
+ import './override/OnRenderGraphicItemProps.js';
package/dist/index.js CHANGED
@@ -275,8 +275,8 @@ var ActivityStoredAbstract = class {
275
275
  this.defaultToDay = props.toDay;
276
276
  this.defaultDisabled = props.disabled || false;
277
277
  this.defaultHidden = props.hidden || false;
278
- this._icon = props.icon;
279
- this._onRun = onRun;
278
+ this._renderIcon = props.renderIcon;
279
+ this._onRun = (props2) => onRun(this, props2);
280
280
  }
281
281
  /**
282
282
  * The name
@@ -359,10 +359,17 @@ var ActivityStoredAbstract = class {
359
359
  this.setStorageProperty("hidden", value);
360
360
  }
361
361
  /**
362
- * The icon element.
362
+ * The function for rendering the icon of the activity.
363
363
  */
364
- get icon() {
365
- return this._icon;
364
+ get renderIcon() {
365
+ if (typeof this._renderIcon !== "function") {
366
+ return (props) => this._renderIcon;
367
+ }
368
+ if (this._renderIcon !== void 0) {
369
+ return (props) => {
370
+ return this._renderIcon(this, props);
371
+ };
372
+ }
366
373
  }
367
374
  /**
368
375
  * The function that is called when the activity is runned.
@@ -393,7 +400,7 @@ var ActivityStoredAbstract = class {
393
400
  toDay: this.getStorageProperty("toDay") || this.defaultToDay,
394
401
  disabled: this.getStorageProperty("disabled") || this.defaultDisabled,
395
402
  hidden: this.getStorageProperty("hidden") || this.defaultHidden,
396
- icon: this._icon
403
+ renderIcon: this._renderIcon
397
404
  };
398
405
  }
399
406
  };
@@ -412,8 +419,8 @@ var ActivityModel = class {
412
419
  this._toDay = props.toDay;
413
420
  this._disabled = props.disabled || false;
414
421
  this._hidden = props.hidden || false;
415
- this._icon = props.icon;
416
- this._onRun = onRun;
422
+ this._renderIcon = props.renderIcon;
423
+ this._onRun = (props2) => onRun(this, props2);
417
424
  }
418
425
  /**
419
426
  * The activity id, that is unique.
@@ -476,16 +483,23 @@ var ActivityModel = class {
476
483
  return this._hidden;
477
484
  }
478
485
  /**
479
- * The icon element.
486
+ * The function for rendering the icon of the activity.
480
487
  */
481
- get icon() {
482
- return this._icon;
488
+ get renderIcon() {
489
+ if (typeof this._renderIcon !== "function") {
490
+ return (props) => this._renderIcon;
491
+ }
492
+ if (this._renderIcon !== void 0) {
493
+ return (props) => {
494
+ return this._renderIcon(this, props);
495
+ };
496
+ }
483
497
  }
484
498
  /**
485
499
  * The function that is called when the activity is runned.
486
500
  */
487
501
  get onRun() {
488
- return () => this._onRun(this);
502
+ return (props) => this._onRun(this, props);
489
503
  }
490
504
  /**
491
505
  * Whether the activity is a deadline.
@@ -510,7 +524,7 @@ var ActivityModel = class {
510
524
  toDay: this._toDay,
511
525
  disabled: this._disabled,
512
526
  hidden: this._hidden,
513
- icon: this._icon
527
+ renderIcon: this._renderIcon
514
528
  };
515
529
  }
516
530
  };
@@ -540,7 +554,7 @@ var CommitmentBaseModel = class extends pixiVn.StoredClassModel {
540
554
  this.defaultToHour = props.toHour;
541
555
  this.defaultFromDay = props.fromDay;
542
556
  this.defaultToDay = props.toDay;
543
- this._image = props.image;
557
+ this._renderImage = props.renderImage;
544
558
  this._executionType = props.executionType || "interaction" /* INTERACTION */;
545
559
  this._onRun = props.onRun;
546
560
  this.defaultDisabled = props.disabled || false;
@@ -605,10 +619,17 @@ var CommitmentBaseModel = class extends pixiVn.StoredClassModel {
605
619
  this.setStorageProperty("toDay", value);
606
620
  }
607
621
  /**
608
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
622
+ * The function for rendering the image of the room.
609
623
  */
610
- get image() {
611
- return this._image;
624
+ get renderImage() {
625
+ if (typeof this._renderImage !== "function") {
626
+ return (props) => this._renderImage;
627
+ }
628
+ if (this.renderImage !== void 0) {
629
+ return (props) => {
630
+ return this.renderImage(this, props);
631
+ };
632
+ }
612
633
  }
613
634
  /**
614
635
  * Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
@@ -732,7 +753,7 @@ var LocationBaseModel = class extends pixiVn.StoredClassModel {
732
753
  this.defaultName = props.name || "";
733
754
  this.defaultDisabled = props.disabled || false;
734
755
  this.defaultHidden = props.hidden || false;
735
- this._icon = props.icon;
756
+ this._renderIcon = props.renderIcon;
736
757
  this._map = map;
737
758
  }
738
759
  /**
@@ -772,10 +793,17 @@ var LocationBaseModel = class extends pixiVn.StoredClassModel {
772
793
  this.setStorageProperty("hidden", value);
773
794
  }
774
795
  /**
775
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
796
+ * The function for rendering the icon of the location.
776
797
  */
777
- get icon() {
778
- return this._icon;
798
+ get renderIcon() {
799
+ if (typeof this._renderIcon !== "function") {
800
+ return (props) => this._renderIcon;
801
+ }
802
+ if (this._renderIcon !== void 0) {
803
+ return (props) => {
804
+ return this._renderIcon(this, props);
805
+ };
806
+ }
779
807
  }
780
808
  /**
781
809
  * The map where the location is.
@@ -822,7 +850,7 @@ var MapBaseModel = class extends pixiVn.StoredClassModel {
822
850
  constructor(id, props = {}) {
823
851
  super(MAP_CATEGORY, id);
824
852
  this.defaultName = props.name || "";
825
- this.defaultImage = props.image;
853
+ this._renderImage = props.renderImage;
826
854
  this.defaultDisabled = props.disabled || false;
827
855
  this.defaultHidden = props.hidden || false;
828
856
  }
@@ -837,14 +865,17 @@ var MapBaseModel = class extends pixiVn.StoredClassModel {
837
865
  this.setStorageProperty("name", value);
838
866
  }
839
867
  /**
840
- * The image of the map. It can be a string, an Element or a Pixi'VN Canvas Item.
841
- * If you set undefined, it will return the initial value of image.
868
+ * The function for rendering the image of the map.
842
869
  */
843
- get image() {
844
- return this.getStorageProperty("image") || this.defaultImage;
845
- }
846
- set image(value) {
847
- this.setStorageProperty("image", value);
870
+ get renderImage() {
871
+ if (typeof this._renderImage !== "function") {
872
+ return (props) => this._renderImage;
873
+ }
874
+ if (this.renderImage !== void 0) {
875
+ return (props) => {
876
+ return this.renderImage(this, props);
877
+ };
878
+ }
848
879
  }
849
880
  /**
850
881
  * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
@@ -1095,11 +1126,11 @@ var RoomBaseModel = class extends pixiVn.StoredClassModel {
1095
1126
  super(ROOM_CATEGORY, id);
1096
1127
  this._location = location;
1097
1128
  this.defaultName = props.name || "";
1098
- this.defaultImage = props.image;
1129
+ this._renderImage = props.renderImage;
1099
1130
  this.defaultActivityIds = ((_a = props.defaultActivities) == null ? void 0 : _a.map((activity) => activity.id)) || [];
1100
1131
  this.defaultDisabled = props.disabled || false;
1101
1132
  this.defaultHidden = props.hidden || false;
1102
- this._icon = props.icon;
1133
+ this._renderIcon = props.renderIcon;
1103
1134
  this._isEntrance = props.isEntrance;
1104
1135
  }
1105
1136
  /**
@@ -1125,14 +1156,17 @@ var RoomBaseModel = class extends pixiVn.StoredClassModel {
1125
1156
  this.setStorageProperty("name", value);
1126
1157
  }
1127
1158
  /**
1128
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
1129
- * If you set undefined, it will return the initial value of image.
1159
+ * The function for rendering the image of the room.
1130
1160
  */
1131
- get image() {
1132
- return this.getStorageProperty("image") || this.defaultImage;
1133
- }
1134
- set image(value) {
1135
- this.setStorageProperty("image", value);
1161
+ get renderImage() {
1162
+ if (typeof this._renderImage !== "function") {
1163
+ return (props) => this._renderImage;
1164
+ }
1165
+ if (this.renderImage !== void 0) {
1166
+ return (props) => {
1167
+ return this.renderImage(this, props);
1168
+ };
1169
+ }
1136
1170
  }
1137
1171
  /**
1138
1172
  * The activities that are available in this room.
@@ -1289,8 +1323,18 @@ var RoomBaseModel = class extends pixiVn.StoredClassModel {
1289
1323
  set hidden(value) {
1290
1324
  this.setStorageProperty("hidden", value);
1291
1325
  }
1292
- get icon() {
1293
- return this._icon;
1326
+ /**
1327
+ * The function for rendering the icon of the room.
1328
+ */
1329
+ get renderIcon() {
1330
+ if (typeof this._renderIcon !== "function") {
1331
+ return (props) => this._renderIcon;
1332
+ }
1333
+ if (this._renderIcon !== void 0) {
1334
+ return (props) => {
1335
+ return this._renderIcon(this, props);
1336
+ };
1337
+ }
1294
1338
  }
1295
1339
  /**
1296
1340
  * Get the character commitments of the room.