mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Don't require animation selection.
This commit is contained in:
parent
b9acf228f8
commit
426744afc1
@ -302,6 +302,8 @@ public class SkeletonViewer extends ApplicationAdapter {
|
|||||||
public UI () {
|
public UI () {
|
||||||
// Configure widgets.
|
// Configure widgets.
|
||||||
|
|
||||||
|
animationList.getSelection().setRequired(false);
|
||||||
|
|
||||||
premultipliedCheckbox.setChecked(true);
|
premultipliedCheckbox.setChecked(true);
|
||||||
|
|
||||||
loopCheckbox.setChecked(true);
|
loopCheckbox.setChecked(true);
|
||||||
@ -463,7 +465,13 @@ public class SkeletonViewer extends ApplicationAdapter {
|
|||||||
|
|
||||||
animationList.addListener(new ChangeListener() {
|
animationList.addListener(new ChangeListener() {
|
||||||
public void changed (ChangeEvent event, Actor actor) {
|
public void changed (ChangeEvent event, Actor actor) {
|
||||||
if (state != null) state.setAnimation(0, animationList.getSelected(), loopCheckbox.isChecked());
|
if (state != null) {
|
||||||
|
String name = animationList.getSelected();
|
||||||
|
if (name == null)
|
||||||
|
state.clearTrack(0);
|
||||||
|
else
|
||||||
|
state.setAnimation(0, name, loopCheckbox.isChecked());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user