mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 10:46:53 +08:00
[libgdx] Skeleton Viewer, use canonical path.
Windows will give a short 8.3 path if the path is very long, then the ".json" extension becomes ".jso".
This commit is contained in:
parent
4bf5c690d0
commit
f07d1aef43
@ -119,8 +119,15 @@ public class SkeletonViewer extends ApplicationAdapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean loadSkeleton (final @Null FileHandle skeletonFile) {
|
boolean loadSkeleton (@Null FileHandle skeletonFile) {
|
||||||
if (skeletonFile == null) return false;
|
if (skeletonFile == null) return false;
|
||||||
|
|
||||||
|
try {
|
||||||
|
skeletonFile = new FileHandle(skeletonFile.file().getCanonicalFile());
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
skeletonFile = new FileHandle(skeletonFile.file().getAbsoluteFile());
|
||||||
|
}
|
||||||
|
|
||||||
FileHandle oldSkeletonFile = this.skeletonFile;
|
FileHandle oldSkeletonFile = this.skeletonFile;
|
||||||
this.skeletonFile = skeletonFile;
|
this.skeletonFile = skeletonFile;
|
||||||
reloadTimer = 0;
|
reloadTimer = 0;
|
||||||
@ -139,7 +146,7 @@ public class SkeletonViewer extends ApplicationAdapter {
|
|||||||
skeletonData = loader.readSkeletonData(skeletonFile);
|
skeletonData = loader.readSkeletonData(skeletonFile);
|
||||||
if (skeletonData.getBones().size == 0) throw new Exception("No bones in skeleton data.");
|
if (skeletonData.getBones().size == 0) throw new Exception("No bones in skeleton data.");
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
System.out.println("Error loading skeleton: " + skeletonFile.file().getAbsolutePath());
|
System.out.println("Error loading skeleton: " + skeletonFile.path());
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
ui.toast("Error loading skeleton: " + skeletonFile.name());
|
ui.toast("Error loading skeleton: " + skeletonFile.name());
|
||||||
this.skeletonFile = oldSkeletonFile;
|
this.skeletonFile = oldSkeletonFile;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user