@urso/core 0.7.37 → 0.7.39

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urso/core",
3
- "version": "0.7.37",
3
+ "version": "0.7.39",
4
4
  "description": "HTML5 game engine",
5
5
  "main": "build/js/index.js",
6
6
  "author": "Megbrimef",
@@ -17,7 +17,7 @@ class LibCache {
17
17
 
18
18
  _setDataToAssetsList(assetType, key, data) {
19
19
  if (this.assetsList[assetType][key])
20
- console.warn(`LibCache ${assetType}: key alredy exists: `, key, data);
20
+ console.warn(`LibCache ${assetType}: key already exists: `, key, data);
21
21
 
22
22
  this.assetsList[assetType][key] = data;
23
23
  }
@@ -104,6 +104,7 @@ class LibLoader {
104
104
  return false;
105
105
 
106
106
  this._isRunning = true;
107
+ this._lastLoadFailed = false;
107
108
  this._iterationNumber++;
108
109
  const currentIteration = this._iterationNumber;
109
110
  this._completeCallback = callback;
@@ -135,7 +136,7 @@ class LibLoader {
135
136
  this._loader.onError.add(this._onError);
136
137
 
137
138
  this._loader.load(function (loader, resources) {
138
- if (currentIteration !== this._iterationNumber)
139
+ if (currentIteration !== this._iterationNumber || this._lastLoadFailed)
139
140
  return;
140
141
 
141
142
  this._onLoadUpdate({ progress: 100 });
@@ -145,12 +146,14 @@ class LibLoader {
145
146
  }.bind(this));
146
147
  };
147
148
 
148
-
149
149
  _onError(error) {
150
150
  Urso.logger.warn('LibLoader file load error: ', error);
151
+
151
152
  this._loader.reset();
152
153
  this._isRunning = false;
154
+ this._lastLoadFailed = true;
153
155
 
156
+ Urso.logger.warn('LibLoader all assets RELOAD...');
154
157
  this._resizeTimeoutId = Urso.setTimeout(() => this.start(this._completeCallback), this.RELOAD_DELAY);
155
158
  }
156
159