Merge pull request #5824 from samme/feature/texture-missing-error-msg

Add texture key to the missing frame warning
This commit is contained in:
Richard Davey 2021-09-20 11:29:19 +01:00 committed by GitHub
commit cb15887bda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ var Class = require('../utils/Class');
var Frame = require('./Frame');
var TextureSource = require('./TextureSource');
var TEXTURE_MISSING_ERROR = 'Texture.frame missing: ';
var TEXTURE_MISSING_ERROR = 'Texture "%s" has no frame "%s"';
/**
* @classdesc
@ -248,7 +248,7 @@ var Texture = new Class({
if (!frame)
{
console.warn(TEXTURE_MISSING_ERROR + name);
console.warn(TEXTURE_MISSING_ERROR, this.key, name);
frame = this.frames[this.firstFrame];
}
@ -376,7 +376,7 @@ var Texture = new Class({
}
else
{
console.warn(TEXTURE_MISSING_ERROR + name);
console.warn(TEXTURE_MISSING_ERROR, this.key, name);
return this.frames['__BASE'].source.image;
}
@ -407,7 +407,7 @@ var Texture = new Class({
if (!frame)
{
console.warn(TEXTURE_MISSING_ERROR + name);
console.warn(TEXTURE_MISSING_ERROR, this.key, name);
idx = this.frames['__BASE'].sourceIndex;
}