From 15e4f2ff4eb6e20588ce482e1968f9a584bff9b9 Mon Sep 17 00:00:00 2001 From: Nathan Sweet Date: Tue, 22 Aug 2017 22:54:28 +0200 Subject: [PATCH] Fixed mouse scroll after focusing list. Fixed loading atlas for .skel.bytes data file. --- .../esotericsoftware/spine/SkeletonViewer.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/SkeletonViewer.java b/spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/SkeletonViewer.java index e329e694d..79deaba19 100644 --- a/spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/SkeletonViewer.java +++ b/spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/SkeletonViewer.java @@ -142,7 +142,8 @@ public class SkeletonViewer extends ApplicationAdapter { pixmap.dispose(); String atlasFileName = skeletonFile.nameWithoutExtension(); - if (atlasFileName.endsWith(".json")) atlasFileName = new FileHandle(atlasFileName).nameWithoutExtension(); + if (atlasFileName.endsWith(".json") || atlasFileName.endsWith(".skel")) + atlasFileName = atlasFileName.substring(0, atlasFileName.length() - 5); FileHandle atlasFile = skeletonFile.sibling(atlasFileName + ".atlas"); if (!atlasFile.exists()) { if (atlasFileName.endsWith("-pro") || atlasFileName.endsWith("-ess")) @@ -706,6 +707,16 @@ public class SkeletonViewer extends ApplicationAdapter { } }); + InputListener scrollFocusListener = new InputListener() { + public void enter (InputEvent event, float x, float y, int pointer, Actor fromActor) { + stage.setScrollFocus(event.getListenerActor()); + } + + public void exit (InputEvent event, float x, float y, int pointer, Actor toActor) { + if (stage.getScrollFocus() == event.getListenerActor()) stage.setScrollFocus(null); + } + }; + animationList.addListener(new ChangeListener() { public void changed (ChangeEvent event, Actor actor) { if (state != null) { @@ -717,6 +728,7 @@ public class SkeletonViewer extends ApplicationAdapter { } } }); + animationList.addListener(scrollFocusListener); loopCheckbox.addListener(new ChangeListener() { public void changed (ChangeEvent event, Actor actor) { @@ -736,6 +748,7 @@ public class SkeletonViewer extends ApplicationAdapter { } } }); + skinList.addListener(scrollFocusListener); ChangeListener trackButtonListener = new ChangeListener() { public void changed (ChangeEvent event, Actor actor) {