@drincs/nqtr 0.1.4 → 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 +11 -10
  2. package/dist/classes/Activity.d.ts +11 -10
  3. package/dist/classes/Activity.js +20 -14
  4. package/dist/classes/Activity.js.map +1 -1
  5. package/dist/classes/Activity.mjs +20 -14
  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 +10 -7
  22. package/dist/classes/navigation/ActivityRoom.js.map +1 -1
  23. package/dist/classes/navigation/ActivityRoom.mjs +10 -7
  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 +26 -18
  40. package/dist/classes/navigation/Room.js.map +1 -1
  41. package/dist/classes/navigation/Room.mjs +26 -18
  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 +40 -30
  46. package/dist/classes/navigation/index.js.map +1 -1
  47. package/dist/classes/navigation/index.mjs +40 -30
  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 +57 -41
  80. package/dist/index.js.map +1 -1
  81. package/dist/index.mjs +57 -41
  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.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-Cu7BBJil.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/GraphicItem.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,16 +359,19 @@ 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
+ return this._renderIcon;
366
369
  }
367
370
  /**
368
371
  * The function that is called when the activity is runned.
369
372
  */
370
373
  get onRun() {
371
- return () => this._onRun(this);
374
+ return (props) => this._onRun(this, props);
372
375
  }
373
376
  /**
374
377
  * Whether the activity is a deadline.
@@ -393,7 +396,7 @@ var ActivityStoredAbstract = class {
393
396
  toDay: this.getStorageProperty("toDay") || this.defaultToDay,
394
397
  disabled: this.getStorageProperty("disabled") || this.defaultDisabled,
395
398
  hidden: this.getStorageProperty("hidden") || this.defaultHidden,
396
- icon: this._icon
399
+ renderIcon: this._renderIcon
397
400
  };
398
401
  }
399
402
  };
@@ -412,8 +415,8 @@ var ActivityModel = class {
412
415
  this._toDay = props.toDay;
413
416
  this._disabled = props.disabled || false;
414
417
  this._hidden = props.hidden || false;
415
- this._icon = props.icon;
416
- this._onRun = onRun;
418
+ this._renderIcon = props.renderIcon;
419
+ this._onRun = (props2) => onRun(this, props2);
417
420
  }
418
421
  /**
419
422
  * The activity id, that is unique.
@@ -476,16 +479,19 @@ var ActivityModel = class {
476
479
  return this._hidden;
477
480
  }
478
481
  /**
479
- * The icon element.
482
+ * The function for rendering the icon of the activity.
480
483
  */
481
- get icon() {
482
- return this._icon;
484
+ get renderIcon() {
485
+ if (typeof this._renderIcon !== "function") {
486
+ return (props) => this._renderIcon;
487
+ }
488
+ return this._renderIcon;
483
489
  }
484
490
  /**
485
491
  * The function that is called when the activity is runned.
486
492
  */
487
493
  get onRun() {
488
- return () => this._onRun(this);
494
+ return (props) => this._onRun(this, props);
489
495
  }
490
496
  /**
491
497
  * Whether the activity is a deadline.
@@ -510,7 +516,7 @@ var ActivityModel = class {
510
516
  toDay: this._toDay,
511
517
  disabled: this._disabled,
512
518
  hidden: this._hidden,
513
- icon: this._icon
519
+ renderIcon: this._renderIcon
514
520
  };
515
521
  }
516
522
  };
@@ -540,7 +546,7 @@ var CommitmentBaseModel = class extends pixiVn.StoredClassModel {
540
546
  this.defaultToHour = props.toHour;
541
547
  this.defaultFromDay = props.fromDay;
542
548
  this.defaultToDay = props.toDay;
543
- this._image = props.image;
549
+ this._renderImage = props.renderImage;
544
550
  this._executionType = props.executionType || "interaction" /* INTERACTION */;
545
551
  this._onRun = props.onRun;
546
552
  this.defaultDisabled = props.disabled || false;
@@ -605,10 +611,13 @@ var CommitmentBaseModel = class extends pixiVn.StoredClassModel {
605
611
  this.setStorageProperty("toDay", value);
606
612
  }
607
613
  /**
608
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
614
+ * The function for rendering the image of the room.
609
615
  */
610
- get image() {
611
- return this._image;
616
+ get renderImage() {
617
+ if (typeof this._renderImage !== "function") {
618
+ return (props) => this._renderImage;
619
+ }
620
+ return this._renderImage;
612
621
  }
613
622
  /**
614
623
  * 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 +741,7 @@ var LocationBaseModel = class extends pixiVn.StoredClassModel {
732
741
  this.defaultName = props.name || "";
733
742
  this.defaultDisabled = props.disabled || false;
734
743
  this.defaultHidden = props.hidden || false;
735
- this._icon = props.icon;
744
+ this._renderIcon = props.renderIcon;
736
745
  this._map = map;
737
746
  }
738
747
  /**
@@ -772,10 +781,13 @@ var LocationBaseModel = class extends pixiVn.StoredClassModel {
772
781
  this.setStorageProperty("hidden", value);
773
782
  }
774
783
  /**
775
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
784
+ * The function for rendering the icon of the location.
776
785
  */
777
- get icon() {
778
- return this._icon;
786
+ get renderIcon() {
787
+ if (typeof this._renderIcon !== "function") {
788
+ return (props) => this._renderIcon;
789
+ }
790
+ return this._renderIcon;
779
791
  }
780
792
  /**
781
793
  * The map where the location is.
@@ -822,7 +834,7 @@ var MapBaseModel = class extends pixiVn.StoredClassModel {
822
834
  constructor(id, props = {}) {
823
835
  super(MAP_CATEGORY, id);
824
836
  this.defaultName = props.name || "";
825
- this.defaultImage = props.image;
837
+ this._renderImege = props.renderImage;
826
838
  this.defaultDisabled = props.disabled || false;
827
839
  this.defaultHidden = props.hidden || false;
828
840
  }
@@ -837,14 +849,13 @@ var MapBaseModel = class extends pixiVn.StoredClassModel {
837
849
  this.setStorageProperty("name", value);
838
850
  }
839
851
  /**
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.
852
+ * The function for rendering the image of the map.
842
853
  */
843
- get image() {
844
- return this.getStorageProperty("image") || this.defaultImage;
845
- }
846
- set image(value) {
847
- this.setStorageProperty("image", value);
854
+ get renderImage() {
855
+ if (typeof this._renderImege !== "function") {
856
+ return (props) => this._renderImege;
857
+ }
858
+ return this._renderImege;
848
859
  }
849
860
  /**
850
861
  * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
@@ -1095,11 +1106,11 @@ var RoomBaseModel = class extends pixiVn.StoredClassModel {
1095
1106
  super(ROOM_CATEGORY, id);
1096
1107
  this._location = location;
1097
1108
  this.defaultName = props.name || "";
1098
- this.defaultImage = props.image;
1109
+ this._renderImege = props.renderImage;
1099
1110
  this.defaultActivityIds = ((_a = props.defaultActivities) == null ? void 0 : _a.map((activity) => activity.id)) || [];
1100
1111
  this.defaultDisabled = props.disabled || false;
1101
1112
  this.defaultHidden = props.hidden || false;
1102
- this._icon = props.icon;
1113
+ this._renderIcon = props.renderIcon;
1103
1114
  this._isEntrance = props.isEntrance;
1104
1115
  }
1105
1116
  /**
@@ -1125,14 +1136,13 @@ var RoomBaseModel = class extends pixiVn.StoredClassModel {
1125
1136
  this.setStorageProperty("name", value);
1126
1137
  }
1127
1138
  /**
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.
1139
+ * The function for rendering the image of the room.
1130
1140
  */
1131
- get image() {
1132
- return this.getStorageProperty("image") || this.defaultImage;
1133
- }
1134
- set image(value) {
1135
- this.setStorageProperty("image", value);
1141
+ get renderImage() {
1142
+ if (typeof this._renderImege !== "function") {
1143
+ return (props) => this._renderImege;
1144
+ }
1145
+ return this._renderImege;
1136
1146
  }
1137
1147
  /**
1138
1148
  * The activities that are available in this room.
@@ -1289,8 +1299,14 @@ var RoomBaseModel = class extends pixiVn.StoredClassModel {
1289
1299
  set hidden(value) {
1290
1300
  this.setStorageProperty("hidden", value);
1291
1301
  }
1292
- get icon() {
1293
- return this._icon;
1302
+ /**
1303
+ * The function for rendering the icon of the room.
1304
+ */
1305
+ get renderIcon() {
1306
+ if (typeof this._renderIcon !== "function") {
1307
+ return (props) => this._renderIcon;
1308
+ }
1309
+ return this._renderIcon;
1294
1310
  }
1295
1311
  /**
1296
1312
  * Get the character commitments of the room.