mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 18:56:54 +08:00
Fixed SkeletonViewer crash when last loaded skeleton can't be loaded.
This commit is contained in:
parent
fae60d8899
commit
ca4373cf01
@ -183,7 +183,6 @@ public class SkeletonViewer extends ApplicationAdapter {
|
|||||||
|
|
||||||
state = new AnimationState(new AnimationStateData(skeletonData));
|
state = new AnimationState(new AnimationStateData(skeletonData));
|
||||||
state.addListener(new AnimationStateAdapter() {
|
state.addListener(new AnimationStateAdapter() {
|
||||||
|
|
||||||
public void event (TrackEntry entry, Event event) {
|
public void event (TrackEntry entry, Event event) {
|
||||||
ui.toast(event.getData().getName());
|
ui.toast(event.getData().getName());
|
||||||
}
|
}
|
||||||
@ -295,19 +294,21 @@ public class SkeletonViewer extends ApplicationAdapter {
|
|||||||
debugRenderer.draw(skeleton);
|
debugRenderer.draw(skeleton);
|
||||||
}
|
}
|
||||||
|
|
||||||
// AnimationState status.
|
if (state != null) {
|
||||||
status.setLength(0);
|
// AnimationState status.
|
||||||
for (int i = 0, n = state.getTracks().size; i < n; i++) {
|
status.setLength(0);
|
||||||
TrackEntry entry = state.getTracks().get(i);
|
for (int i = 0, n = state.getTracks().size; i < n; i++) {
|
||||||
if (entry == null) continue;
|
TrackEntry entry = state.getTracks().get(i);
|
||||||
status.append(i);
|
if (entry == null) continue;
|
||||||
status.append(": [LIGHT_GRAY]");
|
status.append(i);
|
||||||
status(entry);
|
status.append(": [LIGHT_GRAY]");
|
||||||
status.append("[WHITE]");
|
status(entry);
|
||||||
status.append(entry.animation.name);
|
status.append("[WHITE]");
|
||||||
status.append('\n');
|
status.append(entry.animation.name);
|
||||||
|
status.append('\n');
|
||||||
|
}
|
||||||
|
ui.statusLabel.setText(status);
|
||||||
}
|
}
|
||||||
ui.statusLabel.setText(status);
|
|
||||||
|
|
||||||
// Render UI.
|
// Render UI.
|
||||||
ui.render();
|
ui.render();
|
||||||
@ -462,8 +463,7 @@ public class SkeletonViewer extends ApplicationAdapter {
|
|||||||
root.add("Skin:");
|
root.add("Skin:");
|
||||||
root.add(skinScroll).expand().fill().row();
|
root.add(skinScroll).expand().fill().row();
|
||||||
|
|
||||||
root.add(new Image(skin.newDrawable("white", new Color(0x4e4e4eff)))).height(1).fillX().colspan(2).pad(1,0,1,0)
|
root.add(new Image(skin.newDrawable("white", new Color(0x4e4e4eff)))).height(1).fillX().colspan(2).pad(1, 0, 1, 0).row();
|
||||||
.row();
|
|
||||||
|
|
||||||
root.add("Track:");
|
root.add("Track:");
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user