@vpmedia/phaser 1.9.0 → 1.11.0

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/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  @vpmedia/phaser
2
2
  ===============
3
3
 
4
- [![npm version](https://badge.fury.io/js/@vpmedia%2Fphaser.svg?v=1.9.0)](https://badge.fury.io/js/@vpmedia%2Fphaser)
4
+ [![npm version](https://badge.fury.io/js/@vpmedia%2Fphaser.svg?v=1.11.0)](https://badge.fury.io/js/@vpmedia%2Fphaser)
5
5
  [![Node.js CI](https://github.com/vpmedia/phaser/actions/workflows/node.js.yml/badge.svg)](https://github.com/vpmedia/phaser/actions/workflows/node.js.yml)
6
6
 
7
7
  @vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vpmedia/phaser",
3
- "version": "1.9.0",
3
+ "version": "1.11.0",
4
4
  "description": "@vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2",
5
5
  "author": "Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)",
6
6
  "license": "MIT",
@@ -22,7 +22,7 @@
22
22
  "main": "./src/index.js",
23
23
  "devDependencies": {
24
24
  "eslint": "^8.36.0",
25
- "eslint-config-prettier": "^8.7.0",
25
+ "eslint-config-prettier": "^8.8.0",
26
26
  "eslint-plugin-import": "^2.27.5",
27
27
  "eslint-plugin-jest": "^27.2.1",
28
28
  "eslint-plugin-jsdoc": "^40.1.0",
@@ -30,7 +30,7 @@
30
30
  "husky": "^8.0.3",
31
31
  "jest": "^29.5.0",
32
32
  "lint-staged": "^13.2.0",
33
- "prettier": "^2.8.5"
33
+ "prettier": "^2.8.7"
34
34
  },
35
35
  "scripts": {
36
36
  "test": "NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests",
@@ -585,6 +585,7 @@ export default class {
585
585
 
586
586
  xhrLoad(file, url, type, onload, onerror) {
587
587
  this.log('xhrLoad', file);
588
+ const scope = this;
588
589
  const xhr = new XMLHttpRequest();
589
590
  xhr.open('GET', url, true);
590
591
  xhr.responseType = type;
@@ -595,11 +596,16 @@ export default class {
595
596
  xhr.setRequestHeader('Accept', this.headers[file.type]);
596
597
  }
597
598
  onerror = onerror || this.fileError;
598
- const scope = this;
599
599
  xhr.onload = () => {
600
600
  try {
601
601
  if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599) { // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called.
602
- return onerror.call(scope, file, xhr);
602
+ if (scope.isUseRetry && (!file.numRetry || file.numRetry < scope.maxRetry)) {
603
+ file.numRetry = !file.numRetry ? 1 : file.numRetry += 1;
604
+ scope.xhrLoad(file, url, type, onload, onerror);
605
+ return null;
606
+ } else {
607
+ return onerror.call(scope, file, xhr);
608
+ }
603
609
  }
604
610
  return onload.call(scope, file, xhr);
605
611
  } catch (e) {
@@ -260,7 +260,14 @@ export default class extends DisplayObject {
260
260
  }
261
261
 
262
262
  get fill() {
263
- return typeof this.tint === 'number' ? `#${this.tint.toString(16).toUpperCase()}` : this.tint;
263
+ if (typeof this.tint === 'number') {
264
+ let colorStr = this.tint.toString(16);
265
+ while (colorStr.length < 6) {
266
+ colorStr = '0' + colorStr;
267
+ }
268
+ return `#${colorStr.toUpperCase()}`;
269
+ }
270
+ return this.tint;
264
271
  }
265
272
 
266
273
  set fill(value) {