Răsfoiți Sursa

Don't require animation selection.

NathanSweet 9 ani în urmă
părinte
comite
426744afc1

+ 9 - 1
spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/SkeletonViewer.java

@@ -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());
+					}
 				}
 				}
 			});
 			});