use of com.almasb.fxgl.scene.ProgressDialog in project FXGL by AlmasB.
the class RESTClientSample method initInput.
@Override
protected void initInput() {
onKeyDown(KeyCode.Q, "Get Top", () -> {
getGameplay().getLeaderboard().loadTopTask(5).onSuccess(scores -> scores.forEach(System.out::println)).executeAsyncWithDialogFX(new ProgressDialog("Connecting to FXGL server"));
});
onKeyDown(KeyCode.E, "Put New Score", () -> {
getGameplay().getLeaderboard().postNewScoreTask(new ScoreData("AlmasB", 9999)).onSuccess(n -> System.out.println("Success put")).executeAsyncWithDialogFX(new ProgressDialog("Uploading to FXGL server"));
});
}
use of com.almasb.fxgl.scene.ProgressDialog in project FXGL by AlmasB.
the class SaveLoadManager method querySaveFiles.
/**
* Asynchronously (with a progress dialog) loads save files into observable list {@link #saveFiles()}.
*/
public void querySaveFiles() {
log.debug("Querying save files");
loadSaveFilesTask().onSuccess(files -> {
saveFiles.setAll(files);
Collections.sort(saveFiles, SaveFile.RECENT_FIRST);
}).executeAsyncWithDialogFX(new ProgressDialog("Loading save files"));
}
Aggregations