@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.
@@ -11406,7 +11406,7 @@
11406
11406
  }
11407
11407
  }
11408
11408
 
11409
- var engine$1 = "26.5.0";
11409
+ var engine$1 = "26.5.2";
11410
11410
  var bullet = "3.26";
11411
11411
  var lua = "5.4.3";
11412
11412
  var packageVersionInfo = {
@@ -93521,6 +93521,10 @@
93521
93521
  this._clearIntervalHandle = null;
93522
93522
  }
93523
93523
  this._removeEvents();
93524
+ this.items = [];
93525
+ this.itemsMap = new Map();
93526
+ this.itemsTypeMap = new Map();
93527
+ this.itemsByTypeMap = new Map();
93524
93528
  }
93525
93529
  run() {
93526
93530
  const _this = this;
@@ -99715,10 +99719,19 @@
99715
99719
  return typeof (value) === 'object' && typeof (value.r) === 'number' && typeof (value.g) === 'number' && typeof (value.b) === 'number' && typeof (value.a) === 'number';
99716
99720
  }
99717
99721
  function isValidEnum(value, options) {
99718
- return typeof (value) === 'string' && options.includes(value);
99722
+ return typeof (value) === 'string' && options.find((option) => {
99723
+ if (typeof (option) === 'object')
99724
+ return option.value === value;
99725
+ return option === value;
99726
+ });
99719
99727
  }
99720
99728
  function isValidMultiEnum(value, options) {
99721
- return Array.isArray(value) && value.filter((x) => options.includes(x)).length === value.length;
99729
+ return Array.isArray(value) && value.filter((x) => isValidEnum(x, options)).length === value.length;
99730
+ }
99731
+ function getEnumOptionsString(options) {
99732
+ return options.reduce((previousValue, currentValue, currentIndex) => {
99733
+ return previousValue + (currentIndex === 0 ? '' : ', ') + (typeof (currentValue) === 'object' ? currentValue.value : currentValue);
99734
+ });
99722
99735
  }
99723
99736
  if (!field) {
99724
99737
  console.error(`Field ${name} not found!`);
@@ -99780,7 +99793,7 @@
99780
99793
  }
99781
99794
  case "Enum": {
99782
99795
  if (!isValidEnum(value, field.options)) {
99783
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
99796
+ 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)}`);
99784
99797
  return;
99785
99798
  }
99786
99799
  field.value = value;
@@ -99788,7 +99801,7 @@
99788
99801
  }
99789
99802
  case "MultiEnum": {
99790
99803
  if (!isValidMultiEnum(value, field.options)) {
99791
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
99804
+ 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)}`);
99792
99805
  return;
99793
99806
  }
99794
99807
  field.value = value;
@@ -100634,10 +100647,19 @@
100634
100647
  return typeof (value) === 'object' && typeof (value.r) === 'number' && typeof (value.g) === 'number' && typeof (value.b) === 'number' && typeof (value.a) === 'number';
100635
100648
  }
100636
100649
  function isValidEnum(value, options) {
100637
- return typeof (value) === 'string' && options.includes(value);
100650
+ return typeof (value) === 'string' && options.find((option) => {
100651
+ if (typeof (option) === 'object')
100652
+ return option.value === value;
100653
+ return option === value;
100654
+ });
100638
100655
  }
100639
100656
  function isValidMultiEnum(value, options) {
100640
- return Array.isArray(value) && value.filter((x) => options.includes(x)).length === value.length;
100657
+ return Array.isArray(value) && value.filter((x) => isValidEnum(x, options)).length === value.length;
100658
+ }
100659
+ function getEnumOptionsString(options) {
100660
+ return options.reduce((previousValue, currentValue, currentIndex) => {
100661
+ return previousValue + (currentIndex === 0 ? '' : ', ') + (typeof (currentValue) === 'object' ? currentValue.value : currentValue);
100662
+ });
100641
100663
  }
100642
100664
  if (!field) {
100643
100665
  console.error(`Field ${name} not found!`);
@@ -100698,7 +100720,7 @@
100698
100720
  }
100699
100721
  case "Enum": {
100700
100722
  if (!isValidEnum(value, field.options)) {
100701
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
100723
+ 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)}`);
100702
100724
  return;
100703
100725
  }
100704
100726
  field.value = value;
@@ -100706,7 +100728,7 @@
100706
100728
  }
100707
100729
  case "MultiEnum": {
100708
100730
  if (!isValidMultiEnum(value, field.options)) {
100709
- console.error(`The field '${name}' has type 'Enum' which needs a valid entry of the enum options. Your submitted value is invalid.`);
100731
+ 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)}`);
100710
100732
  return;
100711
100733
  }
100712
100734
  field.value = value;
@@ -117848,6 +117870,7 @@
117848
117870
  this.player.dispose();
117849
117871
  await this.renderer.shutdown();
117850
117872
  this.imgui.shutdown();
117873
+ this.itemRepo.clear();
117851
117874
  textureTools.dispose();
117852
117875
  this.shortcuts.dispose();
117853
117876
  this.cameras = [];
@@ -117855,6 +117878,7 @@
117855
117878
  this.updateListenersById = new Map();
117856
117879
  this.initialized = false;
117857
117880
  this.ready = false;
117881
+ Engine._instance = undefined;
117858
117882
  }
117859
117883
  /**
117860
117884
  * Return the state of the item tree
package/dist/player.zip CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminocity/lemonate-engine",
3
- "version": "26.5.0",
3
+ "version": "26.5.2",
4
4
  "productName": "Lemonate Engine",
5
5
  "repository": "https://codeberg.org/Luminocity/lemonate-engine",
6
6
  "homepage": "https://lemonate.io",