@luminocity/lemonate-engine 26.5.0 → 26.5.2

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.
@@ -11390,7 +11390,7 @@ class Item extends EventEmitter {
11390
11390
  }
11391
11391
  }
11392
11392
 
11393
- var engine$1 = "26.5.0";
11393
+ var engine$1 = "26.5.2";
11394
11394
  var bullet = "3.26";
11395
11395
  var lua = "5.4.3";
11396
11396
  var packageVersionInfo = {
@@ -93505,6 +93505,10 @@ class LoadingManager {
93505
93505
  this._clearIntervalHandle = null;
93506
93506
  }
93507
93507
  this._removeEvents();
93508
+ this.items = [];
93509
+ this.itemsMap = new Map();
93510
+ this.itemsTypeMap = new Map();
93511
+ this.itemsByTypeMap = new Map();
93508
93512
  }
93509
93513
  run() {
93510
93514
  const _this = this;
@@ -99699,10 +99703,19 @@ class RtItem extends RtBase {
99699
99703
  return typeof (value) === 'object' && typeof (value.r) === 'number' && typeof (value.g) === 'number' && typeof (value.b) === 'number' && typeof (value.a) === 'number';
99700
99704
  }
99701
99705
  function isValidEnum(value, options) {
99702
- return typeof (value) === 'string' && options.includes(value);
99706
+ return typeof (value) === 'string' && options.find((option) => {
99707
+ if (typeof (option) === 'object')
99708
+ return option.value === value;
99709
+ return option === value;
99710
+ });
99703
99711
  }
99704
99712
  function isValidMultiEnum(value, options) {
99705
- return Array.isArray(value) && value.filter((x) => options.includes(x)).length === value.length;
99713
+ return Array.isArray(value) && value.filter((x) => isValidEnum(x, options)).length === value.length;
99714
+ }
99715
+ function getEnumOptionsString(options) {
99716
+ return options.reduce((previousValue, currentValue, currentIndex) => {
99717
+ return previousValue + (currentIndex === 0 ? '' : ', ') + (typeof (currentValue) === 'object' ? currentValue.value : currentValue);
99718
+ });
99706
99719
  }
99707
99720
  if (!field) {
99708
99721
  console.error(`Field ${name} not found!`);
@@ -99764,7 +99777,7 @@ class RtItem extends RtBase {
99764
99777
  }
99765
99778
  case "Enum": {
99766
99779
  if (!isValidEnum(value, field.options)) {
99767
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
99780
+ 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)}`);
99768
99781
  return;
99769
99782
  }
99770
99783
  field.value = value;
@@ -99772,7 +99785,7 @@ class RtItem extends RtBase {
99772
99785
  }
99773
99786
  case "MultiEnum": {
99774
99787
  if (!isValidMultiEnum(value, field.options)) {
99775
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
99788
+ 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)}`);
99776
99789
  return;
99777
99790
  }
99778
99791
  field.value = value;
@@ -100618,10 +100631,19 @@ class RtSceneObject extends RtBase {
100618
100631
  return typeof (value) === 'object' && typeof (value.r) === 'number' && typeof (value.g) === 'number' && typeof (value.b) === 'number' && typeof (value.a) === 'number';
100619
100632
  }
100620
100633
  function isValidEnum(value, options) {
100621
- return typeof (value) === 'string' && options.includes(value);
100634
+ return typeof (value) === 'string' && options.find((option) => {
100635
+ if (typeof (option) === 'object')
100636
+ return option.value === value;
100637
+ return option === value;
100638
+ });
100622
100639
  }
100623
100640
  function isValidMultiEnum(value, options) {
100624
- return Array.isArray(value) && value.filter((x) => options.includes(x)).length === value.length;
100641
+ return Array.isArray(value) && value.filter((x) => isValidEnum(x, options)).length === value.length;
100642
+ }
100643
+ function getEnumOptionsString(options) {
100644
+ return options.reduce((previousValue, currentValue, currentIndex) => {
100645
+ return previousValue + (currentIndex === 0 ? '' : ', ') + (typeof (currentValue) === 'object' ? currentValue.value : currentValue);
100646
+ });
100625
100647
  }
100626
100648
  if (!field) {
100627
100649
  console.error(`Field ${name} not found!`);
@@ -100682,7 +100704,7 @@ class RtSceneObject extends RtBase {
100682
100704
  }
100683
100705
  case "Enum": {
100684
100706
  if (!isValidEnum(value, field.options)) {
100685
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
100707
+ 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)}`);
100686
100708
  return;
100687
100709
  }
100688
100710
  field.value = value;
@@ -100690,7 +100712,7 @@ class RtSceneObject extends RtBase {
100690
100712
  }
100691
100713
  case "MultiEnum": {
100692
100714
  if (!isValidMultiEnum(value, field.options)) {
100693
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
100715
+ 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)}`);
100694
100716
  return;
100695
100717
  }
100696
100718
  field.value = value;
@@ -117832,6 +117854,7 @@ class Engine {
117832
117854
  this.player.dispose();
117833
117855
  await this.renderer.shutdown();
117834
117856
  this.imgui.shutdown();
117857
+ this.itemRepo.clear();
117835
117858
  textureTools.dispose();
117836
117859
  this.shortcuts.dispose();
117837
117860
  this.cameras = [];
@@ -117839,6 +117862,7 @@ class Engine {
117839
117862
  this.updateListenersById = new Map();
117840
117863
  this.initialized = false;
117841
117864
  this.ready = false;
117865
+ Engine._instance = undefined;
117842
117866
  }
117843
117867
  /**
117844
117868
  * Return the state of the item tree
package/dist/lemonate.js CHANGED
@@ -88153,7 +88153,7 @@ void main() {
88153
88153
  }
88154
88154
  }
88155
88155
 
88156
- var engine$1 = "26.5.0";
88156
+ var engine$1 = "26.5.2";
88157
88157
  var bullet = "3.26";
88158
88158
  var lua = "5.4.3";
88159
88159
  var packageVersionInfo = {
@@ -230671,6 +230671,10 @@ fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRe
230671
230671
  this._clearIntervalHandle = null;
230672
230672
  }
230673
230673
  this._removeEvents();
230674
+ this.items = [];
230675
+ this.itemsMap = new Map();
230676
+ this.itemsTypeMap = new Map();
230677
+ this.itemsByTypeMap = new Map();
230674
230678
  }
230675
230679
  run() {
230676
230680
  const _this = this;
@@ -236865,10 +236869,19 @@ fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRe
236865
236869
  return typeof (value) === 'object' && typeof (value.r) === 'number' && typeof (value.g) === 'number' && typeof (value.b) === 'number' && typeof (value.a) === 'number';
236866
236870
  }
236867
236871
  function isValidEnum(value, options) {
236868
- return typeof (value) === 'string' && options.includes(value);
236872
+ return typeof (value) === 'string' && options.find((option) => {
236873
+ if (typeof (option) === 'object')
236874
+ return option.value === value;
236875
+ return option === value;
236876
+ });
236869
236877
  }
236870
236878
  function isValidMultiEnum(value, options) {
236871
- return Array.isArray(value) && value.filter((x) => options.includes(x)).length === value.length;
236879
+ return Array.isArray(value) && value.filter((x) => isValidEnum(x, options)).length === value.length;
236880
+ }
236881
+ function getEnumOptionsString(options) {
236882
+ return options.reduce((previousValue, currentValue, currentIndex) => {
236883
+ return previousValue + (currentIndex === 0 ? '' : ', ') + (typeof (currentValue) === 'object' ? currentValue.value : currentValue);
236884
+ });
236872
236885
  }
236873
236886
  if (!field) {
236874
236887
  console.error(`Field ${name} not found!`);
@@ -236930,7 +236943,7 @@ fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRe
236930
236943
  }
236931
236944
  case "Enum": {
236932
236945
  if (!isValidEnum(value, field.options)) {
236933
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
236946
+ 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)}`);
236934
236947
  return;
236935
236948
  }
236936
236949
  field.value = value;
@@ -236938,7 +236951,7 @@ fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRe
236938
236951
  }
236939
236952
  case "MultiEnum": {
236940
236953
  if (!isValidMultiEnum(value, field.options)) {
236941
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
236954
+ 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)}`);
236942
236955
  return;
236943
236956
  }
236944
236957
  field.value = value;
@@ -237784,10 +237797,19 @@ fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRe
237784
237797
  return typeof (value) === 'object' && typeof (value.r) === 'number' && typeof (value.g) === 'number' && typeof (value.b) === 'number' && typeof (value.a) === 'number';
237785
237798
  }
237786
237799
  function isValidEnum(value, options) {
237787
- return typeof (value) === 'string' && options.includes(value);
237800
+ return typeof (value) === 'string' && options.find((option) => {
237801
+ if (typeof (option) === 'object')
237802
+ return option.value === value;
237803
+ return option === value;
237804
+ });
237788
237805
  }
237789
237806
  function isValidMultiEnum(value, options) {
237790
- return Array.isArray(value) && value.filter((x) => options.includes(x)).length === value.length;
237807
+ return Array.isArray(value) && value.filter((x) => isValidEnum(x, options)).length === value.length;
237808
+ }
237809
+ function getEnumOptionsString(options) {
237810
+ return options.reduce((previousValue, currentValue, currentIndex) => {
237811
+ return previousValue + (currentIndex === 0 ? '' : ', ') + (typeof (currentValue) === 'object' ? currentValue.value : currentValue);
237812
+ });
237791
237813
  }
237792
237814
  if (!field) {
237793
237815
  console.error(`Field ${name} not found!`);
@@ -237848,7 +237870,7 @@ fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRe
237848
237870
  }
237849
237871
  case "Enum": {
237850
237872
  if (!isValidEnum(value, field.options)) {
237851
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
237873
+ 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)}`);
237852
237874
  return;
237853
237875
  }
237854
237876
  field.value = value;
@@ -237856,7 +237878,7 @@ fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRe
237856
237878
  }
237857
237879
  case "MultiEnum": {
237858
237880
  if (!isValidMultiEnum(value, field.options)) {
237859
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
237881
+ 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)}`);
237860
237882
  return;
237861
237883
  }
237862
237884
  field.value = value;
@@ -267142,6 +267164,7 @@ fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRe
267142
267164
  this.player.dispose();
267143
267165
  await this.renderer.shutdown();
267144
267166
  this.imgui.shutdown();
267167
+ this.itemRepo.clear();
267145
267168
  textureTools.dispose();
267146
267169
  this.shortcuts.dispose();
267147
267170
  this.cameras = [];
@@ -267149,6 +267172,7 @@ fn tsl_biquadraticTexture_array( map : texture_2d_array<f32>, coord : vec2f, iRe
267149
267172
  this.updateListenersById = new Map();
267150
267173
  this.initialized = false;
267151
267174
  this.ready = false;
267175
+ Engine._instance = undefined;
267152
267176
  }
267153
267177
  /**
267154
267178
  * Return the state of the item tree