All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bigcustard.glide.screen.SaveChoiceDialog Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.bigcustard.glide.screen;

import com.badlogic.gdx.scenes.scene2d.ui.Dialog;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.google.common.util.concurrent.SettableFuture;

public class SaveChoiceDialog extends Dialog {
    private SettableFuture futureSaveChoice = SettableFuture.create();

    public SaveChoiceDialog(Skin skin) {
        super("", skin);
        layoutControls();
    }

    public SettableFuture getFutureSaveChoice() {
        return futureSaveChoice;
    }

    @Override
    protected void result(Object save) {
        futureSaveChoice.set((boolean) save);
    }

    private void layoutControls() {
        Table contentTable = getContentTable();
        contentTable.padTop(20).padLeft(40).padRight(40);
        text("Shall I save your game?");
        contentTable.row();
        button("Save", true);
        getButtonTable().getCells().get(0).padRight(40);
        button("Delete", false);
        getButtonTable().pad(25);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy