[ts][player] Improved check if only one skin/animation should be allowed and display buttons accordingly.

This commit is contained in:
badlogic 2019-07-09 16:58:24 +02:00
parent 7f9617a50b
commit ae6892cdfd
5 changed files with 8 additions and 8 deletions

View File

@ -12100,9 +12100,9 @@ var spine;
};
}
this.setupInput();
if (skeletonData.skins.length == 1)
if (skeletonData.skins.length == 1 || (this.config.skins && this.config.skins.length == 1))
this.skinButton.classList.add("spine-player-hidden");
if (skeletonData.animations.length == 1)
if (skeletonData.animations.length == 1 || (this.config.animations && this.config.animations.length == 1))
this.animationButton.classList.add("spine-player-hidden");
this.config.success(this);
this.loaded = true;

File diff suppressed because one or more lines are too long

View File

@ -11433,9 +11433,9 @@ var spine;
};
}
this.setupInput();
if (skeletonData.skins.length == 1)
if (skeletonData.skins.length == 1 || (this.config.skins && this.config.skins.length == 1))
this.skinButton.classList.add("spine-player-hidden");
if (skeletonData.animations.length == 1)
if (skeletonData.animations.length == 1 || (this.config.animations && this.config.animations.length == 1))
this.animationButton.classList.add("spine-player-hidden");
this.config.success(this);
this.loaded = true;

File diff suppressed because one or more lines are too long

View File

@ -969,8 +969,8 @@ module spine {
this.setupInput();
// Hide skin and animation if there's only the default skin / no animation
if (skeletonData.skins.length == 1) this.skinButton.classList.add("spine-player-hidden");
if (skeletonData.animations.length == 1) this.animationButton.classList.add("spine-player-hidden");
if (skeletonData.skins.length == 1 || (this.config.skins && this.config.skins.length == 1)) this.skinButton.classList.add("spine-player-hidden");
if (skeletonData.animations.length == 1 || (this.config.animations && this.config.animations.length == 1)) this.animationButton.classList.add("spine-player-hidden");
this.config.success(this);
this.loaded = true;