@luminocity/lemonate-engine 26.5.1 → 26.5.3

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.
@@ -11406,7 +11406,7 @@
11406
11406
  }
11407
11407
  }
11408
11408
 
11409
- var engine$1 = "26.5.1";
11409
+ var engine$1 = "26.5.3";
11410
11410
  var bullet = "3.26";
11411
11411
  var lua = "5.4.3";
11412
11412
  var packageVersionInfo = {
@@ -71222,7 +71222,9 @@
71222
71222
  autoRecreate = true;
71223
71223
  // item nodes are nodes below an sgitem that are typically owned by the item and not editable.
71224
71224
  // they can be for example further on the fly sgitems, or internal mesh nodes.
71225
+ // The updated timestamp helps to determine if the subnodes need to be refreshed for example in the UI
71225
71226
  itemSubNodes = [];
71227
+ itemSubNodesUpdatedTs = 0;
71226
71228
  recreationMutex = new Mutex();
71227
71229
  container = new THREE.Group();
71228
71230
  boxHelper;
@@ -71313,6 +71315,12 @@
71313
71315
  getItemSubNodes() {
71314
71316
  return this.itemSubNodes;
71315
71317
  }
71318
+ getItemSubNodesUpdatedTs() {
71319
+ return this.itemSubNodesUpdatedTs;
71320
+ }
71321
+ hasSubNodes() {
71322
+ return this.itemSubNodes.length > 0;
71323
+ }
71316
71324
  findSubNodeById(id, subNodes) {
71317
71325
  subNodes = subNodes ?? this.itemSubNodes;
71318
71326
  for (const subNode of subNodes) {
@@ -71338,9 +71346,12 @@
71338
71346
  subNode.dispose();
71339
71347
  });
71340
71348
  this.itemSubNodes = [];
71349
+ this.itemSubNodesUpdatedTs = performance.now();
71341
71350
  }
71342
71351
  createItemSubNodesFromObject3D(obj) {
71343
71352
  this.itemSubNodes = [this._createItemSubNodesFromObject3D(obj, this.block.id, 0)];
71353
+ this.itemSubNodesUpdatedTs = performance.now();
71354
+ //console.log("Item subnodes refreshed.", this, this.itemSubNodes);
71344
71355
  this.updateChildSubnodeParenting();
71345
71356
  this.engine.eventBus.$emit('sgitem:itemNodesUpdated', this);
71346
71357
  }
@@ -99719,10 +99730,19 @@
99719
99730
  return typeof (value) === 'object' && typeof (value.r) === 'number' && typeof (value.g) === 'number' && typeof (value.b) === 'number' && typeof (value.a) === 'number';
99720
99731
  }
99721
99732
  function isValidEnum(value, options) {
99722
- return typeof (value) === 'string' && options.includes(value);
99733
+ return typeof (value) === 'string' && options.find((option) => {
99734
+ if (typeof (option) === 'object')
99735
+ return option.value === value;
99736
+ return option === value;
99737
+ });
99723
99738
  }
99724
99739
  function isValidMultiEnum(value, options) {
99725
- return Array.isArray(value) && value.filter((x) => options.includes(x)).length === value.length;
99740
+ return Array.isArray(value) && value.filter((x) => isValidEnum(x, options)).length === value.length;
99741
+ }
99742
+ function getEnumOptionsString(options) {
99743
+ return options.reduce((previousValue, currentValue, currentIndex) => {
99744
+ return previousValue + (currentIndex === 0 ? '' : ', ') + (typeof (currentValue) === 'object' ? currentValue.value : currentValue);
99745
+ });
99726
99746
  }
99727
99747
  if (!field) {
99728
99748
  console.error(`Field ${name} not found!`);
@@ -99784,7 +99804,7 @@
99784
99804
  }
99785
99805
  case "Enum": {
99786
99806
  if (!isValidEnum(value, field.options)) {
99787
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
99807
+ console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value '${value}' is invalid. Possible values: ${getEnumOptionsString(field.options)}`);
99788
99808
  return;
99789
99809
  }
99790
99810
  field.value = value;
@@ -99792,7 +99812,7 @@
99792
99812
  }
99793
99813
  case "MultiEnum": {
99794
99814
  if (!isValidMultiEnum(value, field.options)) {
99795
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
99815
+ console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value '${value}' is invalid. Possible values: ${getEnumOptionsString(field.options)}`);
99796
99816
  return;
99797
99817
  }
99798
99818
  field.value = value;
@@ -100638,10 +100658,19 @@
100638
100658
  return typeof (value) === 'object' && typeof (value.r) === 'number' && typeof (value.g) === 'number' && typeof (value.b) === 'number' && typeof (value.a) === 'number';
100639
100659
  }
100640
100660
  function isValidEnum(value, options) {
100641
- return typeof (value) === 'string' && options.includes(value);
100661
+ return typeof (value) === 'string' && options.find((option) => {
100662
+ if (typeof (option) === 'object')
100663
+ return option.value === value;
100664
+ return option === value;
100665
+ });
100642
100666
  }
100643
100667
  function isValidMultiEnum(value, options) {
100644
- return Array.isArray(value) && value.filter((x) => options.includes(x)).length === value.length;
100668
+ return Array.isArray(value) && value.filter((x) => isValidEnum(x, options)).length === value.length;
100669
+ }
100670
+ function getEnumOptionsString(options) {
100671
+ return options.reduce((previousValue, currentValue, currentIndex) => {
100672
+ return previousValue + (currentIndex === 0 ? '' : ', ') + (typeof (currentValue) === 'object' ? currentValue.value : currentValue);
100673
+ });
100645
100674
  }
100646
100675
  if (!field) {
100647
100676
  console.error(`Field ${name} not found!`);
@@ -100702,7 +100731,7 @@
100702
100731
  }
100703
100732
  case "Enum": {
100704
100733
  if (!isValidEnum(value, field.options)) {
100705
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
100734
+ console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value '${value}' is invalid. Possible values: ${getEnumOptionsString(field.options)}`);
100706
100735
  return;
100707
100736
  }
100708
100737
  field.value = value;
@@ -100710,7 +100739,7 @@
100710
100739
  }
100711
100740
  case "MultiEnum": {
100712
100741
  if (!isValidMultiEnum(value, field.options)) {
100713
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
100742
+ console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value '${value}' is invalid. Possible values: ${getEnumOptionsString(field.options)}`);
100714
100743
  return;
100715
100744
  }
100716
100745
  field.value = value;
package/dist/player.zip CHANGED
Binary file
@@ -43,6 +43,7 @@ export declare abstract class SgItem extends SgResourceOwner {
43
43
  itemId?: string;
44
44
  autoRecreate: boolean;
45
45
  itemSubNodes: SgItemSubNode[];
46
+ itemSubNodesUpdatedTs: number;
46
47
  recreationMutex: Mutex;
47
48
  container: Object3D;
48
49
  boxHelper?: BoxHelper;
@@ -72,6 +73,8 @@ export declare abstract class SgItem extends SgResourceOwner {
72
73
  updateParenting(): void;
73
74
  getSubNodeId(): string | undefined;
74
75
  getItemSubNodes(): SgItemSubNode[];
76
+ getItemSubNodesUpdatedTs(): number;
77
+ hasSubNodes(): boolean;
75
78
  findSubNodeById(id: string, subNodes?: SgItemSubNode[]): SgItemSubNode | null;
76
79
  traverseSubNodes(func: (subNode: SgItemSubNode) => void, subNodes?: SgItemSubNode[]): void;
77
80
  clearItemNodes(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminocity/lemonate-engine",
3
- "version": "26.5.1",
3
+ "version": "26.5.3",
4
4
  "productName": "Lemonate Engine",
5
5
  "repository": "https://codeberg.org/Luminocity/lemonate-engine",
6
6
  "homepage": "https://lemonate.io",
@@ -43,7 +43,7 @@
43
43
  "dependencies": {
44
44
  "@gltf-transform/core": "^4.0.1",
45
45
  "@gltf-transform/extensions": "^4.0.1",
46
- "@luminocity/lemonate-gateway": "8.3.0",
46
+ "@luminocity/lemonate-gateway": "8.3.1",
47
47
  "@msgpack/msgpack": "3.1.1",
48
48
  "@recast-navigation/three": "^0.42.0",
49
49
  "@sparkjsdev/spark": "^0.1.10",