@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
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,17 @@ 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
+ if (this._renderIcon !== void 0) {
367
+ return (props) => {
368
+ return this._renderIcon(this, props);
369
+ };
370
+ }
364
371
  }
365
372
  /**
366
373
  * The function that is called when the activity is runned.
@@ -391,7 +398,7 @@ var ActivityStoredAbstract = class {
391
398
  toDay: this.getStorageProperty("toDay") || this.defaultToDay,
392
399
  disabled: this.getStorageProperty("disabled") || this.defaultDisabled,
393
400
  hidden: this.getStorageProperty("hidden") || this.defaultHidden,
394
- icon: this._icon
401
+ renderIcon: this._renderIcon
395
402
  };
396
403
  }
397
404
  };
@@ -410,8 +417,8 @@ var ActivityModel = class {
410
417
  this._toDay = props.toDay;
411
418
  this._disabled = props.disabled || false;
412
419
  this._hidden = props.hidden || false;
413
- this._icon = props.icon;
414
- this._onRun = onRun;
420
+ this._renderIcon = props.renderIcon;
421
+ this._onRun = (props2) => onRun(this, props2);
415
422
  }
416
423
  /**
417
424
  * The activity id, that is unique.
@@ -474,16 +481,23 @@ var ActivityModel = class {
474
481
  return this._hidden;
475
482
  }
476
483
  /**
477
- * The icon element.
484
+ * The function for rendering the icon of the activity.
478
485
  */
479
- get icon() {
480
- return this._icon;
486
+ get renderIcon() {
487
+ if (typeof this._renderIcon !== "function") {
488
+ return (props) => this._renderIcon;
489
+ }
490
+ if (this._renderIcon !== void 0) {
491
+ return (props) => {
492
+ return this._renderIcon(this, props);
493
+ };
494
+ }
481
495
  }
482
496
  /**
483
497
  * The function that is called when the activity is runned.
484
498
  */
485
499
  get onRun() {
486
- return () => this._onRun(this);
500
+ return (props) => this._onRun(this, props);
487
501
  }
488
502
  /**
489
503
  * Whether the activity is a deadline.
@@ -508,7 +522,7 @@ var ActivityModel = class {
508
522
  toDay: this._toDay,
509
523
  disabled: this._disabled,
510
524
  hidden: this._hidden,
511
- icon: this._icon
525
+ renderIcon: this._renderIcon
512
526
  };
513
527
  }
514
528
  };
@@ -538,7 +552,7 @@ var CommitmentBaseModel = class extends StoredClassModel {
538
552
  this.defaultToHour = props.toHour;
539
553
  this.defaultFromDay = props.fromDay;
540
554
  this.defaultToDay = props.toDay;
541
- this._image = props.image;
555
+ this._renderImage = props.renderImage;
542
556
  this._executionType = props.executionType || "interaction" /* INTERACTION */;
543
557
  this._onRun = props.onRun;
544
558
  this.defaultDisabled = props.disabled || false;
@@ -603,10 +617,17 @@ var CommitmentBaseModel = class extends StoredClassModel {
603
617
  this.setStorageProperty("toDay", value);
604
618
  }
605
619
  /**
606
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
620
+ * The function for rendering the image of the room.
607
621
  */
608
- get image() {
609
- return this._image;
622
+ get renderImage() {
623
+ if (typeof this._renderImage !== "function") {
624
+ return (props) => this._renderImage;
625
+ }
626
+ if (this.renderImage !== void 0) {
627
+ return (props) => {
628
+ return this.renderImage(this, props);
629
+ };
630
+ }
610
631
  }
611
632
  /**
612
633
  * 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 +751,7 @@ var LocationBaseModel = class extends StoredClassModel {
730
751
  this.defaultName = props.name || "";
731
752
  this.defaultDisabled = props.disabled || false;
732
753
  this.defaultHidden = props.hidden || false;
733
- this._icon = props.icon;
754
+ this._renderIcon = props.renderIcon;
734
755
  this._map = map;
735
756
  }
736
757
  /**
@@ -770,10 +791,17 @@ var LocationBaseModel = class extends StoredClassModel {
770
791
  this.setStorageProperty("hidden", value);
771
792
  }
772
793
  /**
773
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
794
+ * The function for rendering the icon of the location.
774
795
  */
775
- get icon() {
776
- return this._icon;
796
+ get renderIcon() {
797
+ if (typeof this._renderIcon !== "function") {
798
+ return (props) => this._renderIcon;
799
+ }
800
+ if (this._renderIcon !== void 0) {
801
+ return (props) => {
802
+ return this._renderIcon(this, props);
803
+ };
804
+ }
777
805
  }
778
806
  /**
779
807
  * The map where the location is.
@@ -820,7 +848,7 @@ var MapBaseModel = class extends StoredClassModel {
820
848
  constructor(id, props = {}) {
821
849
  super(MAP_CATEGORY, id);
822
850
  this.defaultName = props.name || "";
823
- this.defaultImage = props.image;
851
+ this._renderImage = props.renderImage;
824
852
  this.defaultDisabled = props.disabled || false;
825
853
  this.defaultHidden = props.hidden || false;
826
854
  }
@@ -835,14 +863,17 @@ var MapBaseModel = class extends StoredClassModel {
835
863
  this.setStorageProperty("name", value);
836
864
  }
837
865
  /**
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.
866
+ * The function for rendering the image of the map.
840
867
  */
841
- get image() {
842
- return this.getStorageProperty("image") || this.defaultImage;
843
- }
844
- set image(value) {
845
- this.setStorageProperty("image", value);
868
+ get renderImage() {
869
+ if (typeof this._renderImage !== "function") {
870
+ return (props) => this._renderImage;
871
+ }
872
+ if (this.renderImage !== void 0) {
873
+ return (props) => {
874
+ return this.renderImage(this, props);
875
+ };
876
+ }
846
877
  }
847
878
  /**
848
879
  * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
@@ -1093,11 +1124,11 @@ var RoomBaseModel = class extends StoredClassModel {
1093
1124
  super(ROOM_CATEGORY, id);
1094
1125
  this._location = location;
1095
1126
  this.defaultName = props.name || "";
1096
- this.defaultImage = props.image;
1127
+ this._renderImage = props.renderImage;
1097
1128
  this.defaultActivityIds = ((_a = props.defaultActivities) == null ? void 0 : _a.map((activity) => activity.id)) || [];
1098
1129
  this.defaultDisabled = props.disabled || false;
1099
1130
  this.defaultHidden = props.hidden || false;
1100
- this._icon = props.icon;
1131
+ this._renderIcon = props.renderIcon;
1101
1132
  this._isEntrance = props.isEntrance;
1102
1133
  }
1103
1134
  /**
@@ -1123,14 +1154,17 @@ var RoomBaseModel = class extends StoredClassModel {
1123
1154
  this.setStorageProperty("name", value);
1124
1155
  }
1125
1156
  /**
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.
1157
+ * The function for rendering the image of the room.
1128
1158
  */
1129
- get image() {
1130
- return this.getStorageProperty("image") || this.defaultImage;
1131
- }
1132
- set image(value) {
1133
- this.setStorageProperty("image", value);
1159
+ get renderImage() {
1160
+ if (typeof this._renderImage !== "function") {
1161
+ return (props) => this._renderImage;
1162
+ }
1163
+ if (this.renderImage !== void 0) {
1164
+ return (props) => {
1165
+ return this.renderImage(this, props);
1166
+ };
1167
+ }
1134
1168
  }
1135
1169
  /**
1136
1170
  * The activities that are available in this room.
@@ -1287,8 +1321,18 @@ var RoomBaseModel = class extends StoredClassModel {
1287
1321
  set hidden(value) {
1288
1322
  this.setStorageProperty("hidden", value);
1289
1323
  }
1290
- get icon() {
1291
- return this._icon;
1324
+ /**
1325
+ * The function for rendering the icon of the room.
1326
+ */
1327
+ get renderIcon() {
1328
+ if (typeof this._renderIcon !== "function") {
1329
+ return (props) => this._renderIcon;
1330
+ }
1331
+ if (this._renderIcon !== void 0) {
1332
+ return (props) => {
1333
+ return this._renderIcon(this, props);
1334
+ };
1335
+ }
1292
1336
  }
1293
1337
  /**
1294
1338
  * Get the character commitments of the room.