@drincs/nqtr 0.1.5 → 0.1.6

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 (99) 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 +19 -13
  4. package/dist/classes/Activity.js.map +1 -1
  5. package/dist/classes/Activity.mjs +19 -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 +7 -4
  10. package/dist/classes/Commitment.js.map +1 -1
  11. package/dist/classes/Commitment.mjs +7 -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 +17 -11
  16. package/dist/classes/index.js.map +1 -1
  17. package/dist/classes/index.mjs +17 -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 +9 -6
  22. package/dist/classes/navigation/ActivityRoom.js.map +1 -1
  23. package/dist/classes/navigation/ActivityRoom.mjs +9 -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 +7 -4
  28. package/dist/classes/navigation/Location.js.map +1 -1
  29. package/dist/classes/navigation/Location.mjs +7 -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 +7 -8
  34. package/dist/classes/navigation/Map.js.map +1 -1
  35. package/dist/classes/navigation/Map.mjs +7 -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 +25 -17
  40. package/dist/classes/navigation/Room.js.map +1 -1
  41. package/dist/classes/navigation/Room.mjs +25 -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 +39 -29
  46. package/dist/classes/navigation/index.js.map +1 -1
  47. package/dist/classes/navigation/index.mjs +39 -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 +7 -4
  64. package/dist/functions/NavigationFunctions.js.map +1 -1
  65. package/dist/functions/NavigationFunctions.mjs +7 -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 +7 -4
  72. package/dist/functions/index.js.map +1 -1
  73. package/dist/functions/index.mjs +7 -4
  74. package/dist/functions/index.mjs.map +1 -1
  75. package/dist/{index-Ci6Aw7YE.d.ts → index-Cu7BBJil.d.ts} +24 -27
  76. package/dist/{index-BvCfRbJB.d.mts → index-Lm3w4aIL.d.mts} +24 -27
  77. package/dist/index.d.mts +3 -2
  78. package/dist/index.d.ts +3 -2
  79. package/dist/index.js +56 -40
  80. package/dist/index.js.map +1 -1
  81. package/dist/index.mjs +56 -40
  82. package/dist/index.mjs.map +1 -1
  83. package/dist/override/GraphicItem.d.mts +16 -0
  84. package/dist/override/GraphicItem.d.ts +16 -0
  85. package/dist/override/OnRenderGraphicItemProps.d.mts +19 -0
  86. package/dist/override/OnRenderGraphicItemProps.d.ts +19 -0
  87. package/dist/override/OnRenderGraphicItemProps.js +4 -0
  88. package/dist/override/OnRenderGraphicItemProps.js.map +1 -0
  89. package/dist/override/OnRenderGraphicItemProps.mjs +3 -0
  90. package/dist/override/OnRenderGraphicItemProps.mjs.map +1 -0
  91. package/dist/override/index.d.mts +3 -0
  92. package/dist/override/index.d.ts +3 -0
  93. package/package.json +1 -1
  94. package/dist/types/GraphicItem.d.mts +0 -5
  95. package/dist/types/GraphicItem.d.ts +0 -5
  96. /package/dist/{types → override}/GraphicItem.js +0 -0
  97. /package/dist/{types → override}/GraphicItem.js.map +0 -0
  98. /package/dist/{types → override}/GraphicItem.mjs +0 -0
  99. /package/dist/{types → override}/GraphicItem.mjs.map +0 -0
package/dist/index.mjs CHANGED
@@ -273,8 +273,8 @@ var ActivityStoredAbstract = class {
273
273
  this.defaultToDay = props.toDay;
274
274
  this.defaultDisabled = props.disabled || false;
275
275
  this.defaultHidden = props.hidden || false;
276
- this._icon = props.icon;
277
- this._onRun = onRun;
276
+ this._renderIcon = props.renderIcon;
277
+ this._onRun = (props2) => onRun(this, props2);
278
278
  }
279
279
  /**
280
280
  * The name
@@ -357,10 +357,13 @@ var ActivityStoredAbstract = class {
357
357
  this.setStorageProperty("hidden", value);
358
358
  }
359
359
  /**
360
- * The icon element.
360
+ * The function for rendering the icon of the activity.
361
361
  */
362
- get icon() {
363
- return this._icon;
362
+ get renderIcon() {
363
+ if (typeof this._renderIcon !== "function") {
364
+ return (props) => this._renderIcon;
365
+ }
366
+ return this._renderIcon;
364
367
  }
365
368
  /**
366
369
  * The function that is called when the activity is runned.
@@ -391,7 +394,7 @@ var ActivityStoredAbstract = class {
391
394
  toDay: this.getStorageProperty("toDay") || this.defaultToDay,
392
395
  disabled: this.getStorageProperty("disabled") || this.defaultDisabled,
393
396
  hidden: this.getStorageProperty("hidden") || this.defaultHidden,
394
- icon: this._icon
397
+ renderIcon: this._renderIcon
395
398
  };
396
399
  }
397
400
  };
@@ -410,8 +413,8 @@ var ActivityModel = class {
410
413
  this._toDay = props.toDay;
411
414
  this._disabled = props.disabled || false;
412
415
  this._hidden = props.hidden || false;
413
- this._icon = props.icon;
414
- this._onRun = onRun;
416
+ this._renderIcon = props.renderIcon;
417
+ this._onRun = (props2) => onRun(this, props2);
415
418
  }
416
419
  /**
417
420
  * The activity id, that is unique.
@@ -474,16 +477,19 @@ var ActivityModel = class {
474
477
  return this._hidden;
475
478
  }
476
479
  /**
477
- * The icon element.
480
+ * The function for rendering the icon of the activity.
478
481
  */
479
- get icon() {
480
- return this._icon;
482
+ get renderIcon() {
483
+ if (typeof this._renderIcon !== "function") {
484
+ return (props) => this._renderIcon;
485
+ }
486
+ return this._renderIcon;
481
487
  }
482
488
  /**
483
489
  * The function that is called when the activity is runned.
484
490
  */
485
491
  get onRun() {
486
- return () => this._onRun(this);
492
+ return (props) => this._onRun(this, props);
487
493
  }
488
494
  /**
489
495
  * Whether the activity is a deadline.
@@ -508,7 +514,7 @@ var ActivityModel = class {
508
514
  toDay: this._toDay,
509
515
  disabled: this._disabled,
510
516
  hidden: this._hidden,
511
- icon: this._icon
517
+ renderIcon: this._renderIcon
512
518
  };
513
519
  }
514
520
  };
@@ -538,7 +544,7 @@ var CommitmentBaseModel = class extends StoredClassModel {
538
544
  this.defaultToHour = props.toHour;
539
545
  this.defaultFromDay = props.fromDay;
540
546
  this.defaultToDay = props.toDay;
541
- this._image = props.image;
547
+ this._renderImage = props.renderImage;
542
548
  this._executionType = props.executionType || "interaction" /* INTERACTION */;
543
549
  this._onRun = props.onRun;
544
550
  this.defaultDisabled = props.disabled || false;
@@ -603,10 +609,13 @@ var CommitmentBaseModel = class extends StoredClassModel {
603
609
  this.setStorageProperty("toDay", value);
604
610
  }
605
611
  /**
606
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
612
+ * The function for rendering the image of the room.
607
613
  */
608
- get image() {
609
- return this._image;
614
+ get renderImage() {
615
+ if (typeof this._renderImage !== "function") {
616
+ return (props) => this._renderImage;
617
+ }
618
+ return this._renderImage;
610
619
  }
611
620
  /**
612
621
  * 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.
@@ -730,7 +739,7 @@ var LocationBaseModel = class extends StoredClassModel {
730
739
  this.defaultName = props.name || "";
731
740
  this.defaultDisabled = props.disabled || false;
732
741
  this.defaultHidden = props.hidden || false;
733
- this._icon = props.icon;
742
+ this._renderIcon = props.renderIcon;
734
743
  this._map = map;
735
744
  }
736
745
  /**
@@ -770,10 +779,13 @@ var LocationBaseModel = class extends StoredClassModel {
770
779
  this.setStorageProperty("hidden", value);
771
780
  }
772
781
  /**
773
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
782
+ * The function for rendering the icon of the location.
774
783
  */
775
- get icon() {
776
- return this._icon;
784
+ get renderIcon() {
785
+ if (typeof this._renderIcon !== "function") {
786
+ return (props) => this._renderIcon;
787
+ }
788
+ return this._renderIcon;
777
789
  }
778
790
  /**
779
791
  * The map where the location is.
@@ -820,7 +832,7 @@ var MapBaseModel = class extends StoredClassModel {
820
832
  constructor(id, props = {}) {
821
833
  super(MAP_CATEGORY, id);
822
834
  this.defaultName = props.name || "";
823
- this.defaultImage = props.image;
835
+ this._renderImege = props.renderImage;
824
836
  this.defaultDisabled = props.disabled || false;
825
837
  this.defaultHidden = props.hidden || false;
826
838
  }
@@ -835,14 +847,13 @@ var MapBaseModel = class extends StoredClassModel {
835
847
  this.setStorageProperty("name", value);
836
848
  }
837
849
  /**
838
- * The image of the map. It can be a string, an Element or a Pixi'VN Canvas Item.
839
- * If you set undefined, it will return the initial value of image.
850
+ * The function for rendering the image of the map.
840
851
  */
841
- get image() {
842
- return this.getStorageProperty("image") || this.defaultImage;
843
- }
844
- set image(value) {
845
- this.setStorageProperty("image", value);
852
+ get renderImage() {
853
+ if (typeof this._renderImege !== "function") {
854
+ return (props) => this._renderImege;
855
+ }
856
+ return this._renderImege;
846
857
  }
847
858
  /**
848
859
  * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
@@ -1093,11 +1104,11 @@ var RoomBaseModel = class extends StoredClassModel {
1093
1104
  super(ROOM_CATEGORY, id);
1094
1105
  this._location = location;
1095
1106
  this.defaultName = props.name || "";
1096
- this.defaultImage = props.image;
1107
+ this._renderImege = props.renderImage;
1097
1108
  this.defaultActivityIds = ((_a = props.defaultActivities) == null ? void 0 : _a.map((activity) => activity.id)) || [];
1098
1109
  this.defaultDisabled = props.disabled || false;
1099
1110
  this.defaultHidden = props.hidden || false;
1100
- this._icon = props.icon;
1111
+ this._renderIcon = props.renderIcon;
1101
1112
  this._isEntrance = props.isEntrance;
1102
1113
  }
1103
1114
  /**
@@ -1123,14 +1134,13 @@ var RoomBaseModel = class extends StoredClassModel {
1123
1134
  this.setStorageProperty("name", value);
1124
1135
  }
1125
1136
  /**
1126
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
1127
- * If you set undefined, it will return the initial value of image.
1137
+ * The function for rendering the image of the room.
1128
1138
  */
1129
- get image() {
1130
- return this.getStorageProperty("image") || this.defaultImage;
1131
- }
1132
- set image(value) {
1133
- this.setStorageProperty("image", value);
1139
+ get renderImage() {
1140
+ if (typeof this._renderImege !== "function") {
1141
+ return (props) => this._renderImege;
1142
+ }
1143
+ return this._renderImege;
1134
1144
  }
1135
1145
  /**
1136
1146
  * The activities that are available in this room.
@@ -1287,8 +1297,14 @@ var RoomBaseModel = class extends StoredClassModel {
1287
1297
  set hidden(value) {
1288
1298
  this.setStorageProperty("hidden", value);
1289
1299
  }
1290
- get icon() {
1291
- return this._icon;
1300
+ /**
1301
+ * The function for rendering the icon of the room.
1302
+ */
1303
+ get renderIcon() {
1304
+ if (typeof this._renderIcon !== "function") {
1305
+ return (props) => this._renderIcon;
1306
+ }
1307
+ return this._renderIcon;
1292
1308
  }
1293
1309
  /**
1294
1310
  * Get the character commitments of the room.