event.cancel();
return true;
}
});
browseButton.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
FileDialog fileDialog = new FileDialog((Frame)null, "Choose skeleton file");
fileDialog.setMode(FileDialog.LOAD);
fileDialog.setVisible(true);
String name = fileDialog.getFile();
String dir = fileDialog.getDirectory();
if (name == null || dir == null) return;
loadSkeleton(new FileHandle(new File(dir, name).getAbsolutePath()), false);
}
});
setupPoseButton.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
if (skeleton != null) skeleton.setToSetupPose();
}
});
bonesSetupPoseButton.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
if (skeleton != null) skeleton.setBonesToSetupPose();
}
});
slotsSetupPoseButton.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
if (skeleton != null) skeleton.setSlotsToSetupPose();
}
});
minimizeButton.addListener(new ClickListener() {
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
event.cancel();
return super.touchDown(event, x, y, pointer, button);
}
public void clicked (InputEvent event, float x, float y) {
if (minimizeButton.isChecked()) {
window.getCells().get(0).setActor(null);
window.setHeight(20);
minimizeButton.setText("+");
} else {
window.getCells().get(0).setActor(root);
ui.window.setHeight(Gdx.graphics.getHeight());
minimizeButton.setText("-");
}
}
});
scaleSlider.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
scaleLabel.setText(Float.toString((int)(scaleSlider.getValue() * 100) / 100f));
if (!scaleSlider.isDragging()) loadSkeleton(skeletonFile, false);
}
});
speedSlider.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
speedLabel.setText(Float.toString((int)(speedSlider.getValue() * 100) / 100f));
}
});
mixSlider.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
mixLabel.setText(Float.toString((int)(mixSlider.getValue() * 100) / 100f));
if (state != null) state.getData().setDefaultMix(mixSlider.getValue());
}
});
animationList.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
if (state != null) state.setAnimation(0, animationList.getSelected(), loopCheckbox.isChecked());
}
});
skinList.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
if (skeleton != null) {
skeleton.setSkin(skinList.getSelected());
skeleton.setSlotsToSetupPose();
}