Example usage for com.badlogic.gdx.scenes.scene2d.ui TextButton getText

List of usage examples for com.badlogic.gdx.scenes.scene2d.ui TextButton getText

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d.ui TextButton getText.

Prototype

public CharSequence getText() 

Source Link

Usage

From source file:awakening.view.menu.Controls.java

License:Apache License

/**
 * Set key to game' settings/*from   w w w.j a va 2  s. c o m*/
 * 
 * @param b TextButton
 * @param key Key's Name
 * @param keyValue Key's value
 */
private void changeKey(TextButton b, String key, int keyValue) {
    if (b.equals(btnUp)) {
        btnUp.setText(key);
        game.setUpKey(key);
        game.setUp(keyValue);

        if (game.getLeft() == keyValue) {
            System.out.println(btnUp.getText());
            System.out.println(b.getText());
            btnLeft.setText("UNKNOWN");
            game.setLeft(Input.Keys.UNKNOWN);
            game.setLeftKey("UNKNOWN");
        } else if (game.getRight() == keyValue) {
            btnRight.setText("UNKNOWN");
            game.setRight(Input.Keys.UNKNOWN);
            game.setRightKey("UNKNOWN");
        } else if (game.getDown() == keyValue) {
            btnDown.setText("UNKNOWN");
            game.setDown(Input.Keys.UNKNOWN);
            game.setDownKey("UNKNOWN");
        } else if (game.getZoomIn() == keyValue) {
            btnZoomIn.setText("UNKNOWN");
            game.setZoomIn(Input.Keys.UNKNOWN);
            game.setZoomInKey("UNKNOWN");
        } else if (game.getZoomOut() == keyValue) {
            btnZoomOut.setText("UNKNOWN");
            game.setZoomOut(Input.Keys.UNKNOWN);
            game.setZoomOutKey("UNKNOWN");
        }
    } else if (b.equals(btnDown)) {
        btnDown.setText(key);
        game.setDownKey(key);
        game.setDown(keyValue);

        if (game.getLeft() == keyValue) {
            btnLeft.setText("UNKNOWN");
            game.setLeft(Input.Keys.UNKNOWN);
            game.setLeftKey("UNKNOWN");
        } else if (game.getRight() == keyValue) {
            btnRight.setText("UNKNOWN");
            game.setRight(Input.Keys.UNKNOWN);
            game.setRightKey("UNKNOWN");
        } else if (game.getUp() == keyValue) {
            btnUp.setText("UNKNOWN");
            game.setUp(Input.Keys.UNKNOWN);
            game.setUpKey("UNKNOWN");
        } else if (game.getZoomIn() == keyValue) {
            btnZoomIn.setText("UNKNOWN");
            game.setZoomIn(Input.Keys.UNKNOWN);
            game.setZoomInKey("UNKNOWN");
        } else if (game.getZoomOut() == keyValue) {
            btnZoomOut.setText("UNKNOWN");
            game.setZoomOut(Input.Keys.UNKNOWN);
            game.setZoomOutKey("UNKNOWN");
        }
    } else if (b.equals(btnLeft)) {
        btnLeft.setText(key);
        game.setLeftKey(key);
        game.setLeft(keyValue);

        if (game.getUp() == keyValue) {
            btnUp.setText("UNKNOWN");
            game.setUp(Input.Keys.UNKNOWN);
            game.setUpKey("UNKNOWN");
        } else if (game.getRight() == keyValue) {
            btnRight.setText("UNKNOWN");
            game.setRight(Input.Keys.UNKNOWN);
            game.setRightKey("UNKNOWN");
        } else if (game.getDown() == keyValue) {
            btnDown.setText("UNKNOWN");
            game.setDown(Input.Keys.UNKNOWN);
            game.setDownKey("UNKNOWN");
        } else if (game.getZoomIn() == keyValue) {
            btnZoomIn.setText("UNKNOWN");
            game.setZoomIn(Input.Keys.UNKNOWN);
            game.setZoomInKey("UNKNOWN");
        } else if (game.getZoomOut() == keyValue) {
            btnZoomOut.setText("UNKNOWN");
            game.setZoomOut(Input.Keys.UNKNOWN);
            game.setZoomOutKey("UNKNOWN");
        }
    } else if (b.equals(btnRight)) {
        btnRight.setText(key);
        game.setRightKey(key);
        game.setRight(keyValue);

        if (game.getLeft() == keyValue) {
            btnLeft.setText("UNKNOWN");
            game.setLeft(Input.Keys.UNKNOWN);
            game.setLeftKey("UNKNOWN");
        } else if (game.getUp() == keyValue) {
            btnUp.setText("UNKNOWN");
            game.setUp(Input.Keys.UNKNOWN);
            game.setUpKey("UNKNOWN");
        } else if (game.getDown() == keyValue) {
            btnDown.setText("UNKNOWN");
            game.setDown(Input.Keys.UNKNOWN);
            game.setDownKey("UNKNOWN");
        } else if (game.getZoomIn() == keyValue) {
            btnZoomIn.setText("UNKNOWN");
            game.setZoomIn(Input.Keys.UNKNOWN);
            game.setZoomInKey("UNKNOWN");
        } else if (game.getZoomOut() == keyValue) {
            btnZoomOut.setText("UNKNOWN");
            game.setZoomOut(Input.Keys.UNKNOWN);
            game.setZoomOutKey("UNKNOWN");
        }
    } else if (b.equals(btnZoomIn)) {
        btnZoomIn.setText(key);
        game.setZoomInKey(key);
        game.setZoomIn(keyValue);

        if (game.getLeft() == keyValue) {
            btnLeft.setText("UNKNOWN");
            game.setLeft(Input.Keys.UNKNOWN);
            game.setLeftKey("UNKNOWN");
        } else if (game.getRight() == keyValue) {
            btnRight.setText("UNKNOWN");
            game.setRight(Input.Keys.UNKNOWN);
            game.setRightKey("UNKNOWN");
        } else if (game.getDown() == keyValue) {
            btnDown.setText("UNKNOWN");
            game.setDown(Input.Keys.UNKNOWN);
            game.setDownKey("UNKNOWN");
        } else if (game.getUp() == keyValue) {
            btnUp.setText("UNKNOWN");
            game.setUp(Input.Keys.UNKNOWN);
            game.setUpKey("UNKNOWN");
        } else if (game.getZoomOut() == keyValue) {
            btnZoomOut.setText("UNKNOWN");
            game.setZoomOut(Input.Keys.UNKNOWN);
            game.setZoomOutKey("UNKNOWN");
        }
    } else if (b.equals(btnZoomOut)) {
        btnZoomOut.setText(key);
        game.setZoomOutKey(key);
        game.setZoomOut(keyValue);

        if (game.getLeft() == keyValue) {
            btnLeft.setText("UNKNOWN");
            game.setLeft(Input.Keys.UNKNOWN);
            game.setLeftKey("UNKNOWN");
        } else if (game.getRight() == keyValue) {
            btnRight.setText("UNKNOWN");
            game.setRight(Input.Keys.UNKNOWN);
            game.setRightKey("UNKNOWN");
        } else if (game.getDown() == keyValue) {
            btnDown.setText("UNKNOWN");
            game.setDown(Input.Keys.UNKNOWN);
            game.setDownKey("UNKNOWN");
        } else if (game.getZoomIn() == keyValue) {
            btnZoomIn.setText("UNKNOWN");
            game.setZoomIn(Input.Keys.UNKNOWN);
            game.setZoomInKey("UNKNOWN");
        } else if (game.getUp() == keyValue) {
            btnUp.setText("UNKNOWN");
            game.setUp(Input.Keys.UNKNOWN);
            game.setUpKey("UNKNOWN");
        }
    }

    b.setChecked(false);
    btnUp.setTouchable(Touchable.enabled);
    btnDown.setTouchable(Touchable.enabled);
    btnLeft.setTouchable(Touchable.enabled);
    btnRight.setTouchable(Touchable.enabled);
    btnZoomIn.setTouchable(Touchable.enabled);
    btnZoomOut.setTouchable(Touchable.enabled);
    btnBack.setTouchable(Touchable.enabled);
    slbLangages.setTouchable(Touchable.enabled);
    btnUp.setColor(btnBack.getColor());
    btnDown.setColor(btnBack.getColor());
    btnLeft.setColor(btnBack.getColor());
    btnRight.setColor(btnBack.getColor());
    btnZoomIn.setColor(btnBack.getColor());
    btnZoomOut.setColor(btnBack.getColor());
}

From source file:com.bladecoder.engineeditor.ui.components.ScopePanel.java

License:Apache License

public void changeScope(TextButton b) {
    b.setChecked(true);

    scopeChanged(b.getText().toString());
}

From source file:com.jupiter.europa.scene2d.ui.TabbedPane.java

License:Open Source License

public void setCurrentTab(String tabName) {
    if (tabs.containsKey(tabName)) {
        if (this.currentTab != null) {
            Actor oldTab = this.currentTab;
            this.currentTab = this.tabs.get(tabName);
            this.getCell(oldTab).setActor(this.currentTab);
        } else {/*from  ww w  .j a  v a2s .  c  om*/
            this.currentTab = this.tabs.get(tabName);
            this.add(this.currentTab).expand().fillX().top();
        }

        this.buttons.keySet().stream().forEach((String key) -> {
            TextButton button = this.buttons.get(key);
            button.setChecked(button.getText().toString().equals(tabName));
        });

        this.invalidate();
    }
}

From source file:com.jupiter.europa.scene2d.ui.TabbedPane.java

License:Open Source License

private void tabButtonClicked(TextButton tabButton) {
    this.setCurrentTab(tabButton.getText().toString());
}

From source file:com.strategames.ui.dialogs.WheelSpinnerDialog.java

License:Open Source License

public Dialog create() {
    setWidth(150);//from   www .  j a va  2  s. c om
    setHeight(200);

    if (this.title != null) {
        Label label = new Label(this.title, this.skin);
        add(label).top();
        row();
    }

    Table buttonTable = new Table(this.skin);
    for (int i = 0; i < items.length; i++) {
        final TextButton button = new TextButton(items[i], this.skin);
        button.addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {
                selectedItem = Integer.parseInt(button.getText().toString());
                OnClickListener listener = getOnClickListener();
                if (listener != null) {
                    listener.onClick(WheelSpinnerDialog.this, ITEM_SELECTED);
                }
            }
        });
        buttonTable.add(button).width(50);
        buttonTable.row();
    }

    ScrollPane scrollPane = new ScrollPane(buttonTable, this.skin);
    add(scrollPane).maxHeight(150);
    row();

    setNegativeButton("Cancel");

    return super.create();
}

From source file:com.tumblr.oddlydrawn.nahlc.screens.GameOverScreen.java

License:Apache License

public GameOverScreen(Game g, int level, int score) {
    game = g;/*from  w ww .  jav a  2 s . c  o  m*/
    savedStuff = new SavedStuff();
    assets = new Assets();
    assets.initGameOver();
    stage = new Stage(new StretchViewport(Renderer.WIDTH, Renderer.HEIGHT));
    skin = new Skin();

    savedStuff.loadScores();
    savedStuff.setScore(score);

    skin.add("default", new BitmapFont(Gdx.files.internal("data/fonts/deja.fnt")));

    LabelStyle labelStyle = new LabelStyle();
    labelStyle.font = skin.getFont("default");
    skin.add("default", labelStyle);

    ButtonStyle buttonStyle = new ButtonStyle();
    skin.add("default", buttonStyle);

    TextButtonStyle textButtonStyle = new TextButtonStyle();
    textButtonStyle.font = skin.getFont("default");
    skin.add("default", textButtonStyle);

    // Background NinePatch image
    Image boxPatchImage = new Image(assets.getBoxPatch());
    boxPatchImage.setSize(Renderer.WIDTH - 40, Renderer.HEIGHT - 5);
    boxPatchImage.setPosition(20, 2);
    stage.addActor(boxPatchImage);

    // Top Score's background NinePatch image
    Image boxPatchImageTwo = new Image(assets.getBoxPatch());
    boxPatchImageTwo.setSize(220, 295);
    boxPatchImageTwo.setPosition(50, 90);
    stage.addActor(boxPatchImageTwo);

    // Single-column table that holds all the things.
    rootTable = new Table();
    rootTable.setFillParent(true);
    stage.addActor(rootTable);
    rootTable.debug();

    // Three-column table that holds the top scores.
    topScoreTable = new Table();
    topScoreTable.debug();
    topScoreTable.columnDefaults(0).width(73);
    topScoreTable.columnDefaults(1).width(50);
    topScoreTable.columnDefaults(1).align(Align.center);

    Label scoreLabel = new Label("Score: " + score, skin);
    Label topScoresLabel = new Label("Top Scores", skin);

    Image mainMenuImage = new Image(assets.getMainMenuSprite());
    Image newGameImage = new Image(assets.getNewGameSprite());

    Button mainMenuButton = new Button(skin);
    mainMenuButton.add(mainMenuImage);

    Button newGameButton = new Button(skin);
    newGameButton.add(newGameImage);

    Image newRecordImage = new Image(assets.getNewRecordSprite());
    Image gameOverImage = new Image(assets.getGameOverSprite());

    Image titleImage;
    if (savedStuff.isPreviousScoreInTopScore()) {
        titleImage = newRecordImage;
    } else {
        titleImage = gameOverImage;
    }

    Label[][] allTheScores = new Label[3][11];

    // Creates the labels for all the scores, populates them, and adds animations.
    for (int y = 0; y < 10; y++) {
        for (int x = 0; x < 3; x++) {
            switch (x) {
            case 0: // The labels from 1 - 10, left most to show score rank.
                if (y == 9) {
                    allTheScores[x][y] = new Label(String.valueOf(y + 1) + ".", skin);
                } else {
                    // Adds a space, for correct padding to numbers 1-9 (or the array indexes 0-8)
                    allTheScores[x][y] = new Label(" " + String.valueOf(y + 1) + ".", skin);
                }
                topScoreTable.add(allTheScores[x][y]);
                break;
            case 1: // The labels with the Level associated with each score
                allTheScores[x][y] = new Label(savedStuff.getLevel(y, x - 1), skin);
                topScoreTable.add(allTheScores[x][y]);

                if (savedStuff.isPreviousScoreInTopScore()) {
                    // Adds the drop animation to scores below the score to replace
                    if (y >= savedStuff.getScoreToReplace()) {
                        allTheScores[x][y].addAction(Actions.sequence(Actions.delay(2f), Actions.delay(0.5f),
                                Actions.moveBy(0, -26, 2, Interpolation.bounceOut)));
                    }
                }
                break;
            case 2: // The labels with the Score associated with each rank and level
                allTheScores[x][y] = new Label(savedStuff.getScore(y, x - 1), skin);
                topScoreTable.add(allTheScores[x][y]).right();

                if (savedStuff.isPreviousScoreInTopScore()) {
                    // Adds the drop animation to scores below the score to replace
                    if (y >= savedStuff.getScoreToReplace()) {
                        allTheScores[x][y].addAction(Actions.sequence(Actions.delay(2f), Actions.delay(0.5f),
                                Actions.moveBy(0, -26, 2, Interpolation.bounceOut)));
                    }
                }
                break;
            default:
                break;
            }
        }
        topScoreTable.row();
    }

    rootTable.add(titleImage);
    rootTable.row();

    rootTable.add(scoreLabel).expand();
    rootTable.row();

    rootTable.add(topScoresLabel);
    rootTable.row();
    topScoreTable.setWidth(rootTable.getWidth());
    topScoreTable.setTransform(true);
    rootTable.setTransform(true);
    rootTable.add(topScoreTable);
    rootTable.row();

    rootTable.add(newGameButton).expand().bottom();
    rootTable.row();
    rootTable.add(mainMenuButton).expand();

    rootTable.padLeft(35f);
    rootTable.padRight(35f);
    rootTable.padTop(9f);
    rootTable.padBottom(9f);

    newGameButton.toBack();
    mainMenuButton.toBack();

    // Adds padding to Level and 10th rank strings for correct padding
    String levelButtonString;
    int mew = Integer.valueOf(String.valueOf(allTheScores[1][9].getText()));
    if (mew < 10) {
        levelButtonString = String.valueOf(allTheScores[1][9].getText()) + " ";
    } else {
        levelButtonString = String.valueOf(allTheScores[1][9].getText());
    }
    String previousLevelButtonString;
    if (level < 10) {
        previousLevelButtonString = String.valueOf(level + " ");
    } else {
        previousLevelButtonString = String.valueOf(level);
    }
    String previousScoreString = String.valueOf(score);

    TextButton previousLevelButton = new TextButton(previousLevelButtonString, skin);
    TextButton previousScoreButton = new TextButton(previousScoreString, skin);
    TextButton tenthLevelButton = new TextButton(levelButtonString, skin);
    TextButton tenthScoreButton = new TextButton(String.valueOf(allTheScores[2][9].getText()), skin);

    // Pads Button text with spaces for correct alignment
    tenthLevelButton.setText(fillStringWithSpaces(String.valueOf(tenthLevelButton.getText())));
    previousLevelButton.setText(fillStringWithSpaces(previousLevelButtonString));
    stage.addActor(tenthLevelButton);
    stage.addActor(tenthScoreButton);

    // Groups to link the scores and levels for 10th-rank scores and the score just obtained
    // Needed to apply transforms to buttons since transforming text isn't possible, I think.
    Group group = new Group();
    group.addActor(tenthScoreButton);
    group.addActor(tenthLevelButton);

    Group groupPrevious = new Group();
    groupPrevious.addActor(previousLevelButton);
    groupPrevious.addActor(previousScoreButton);

    // Modifies score buttons positions for correct alignment with the rest of the table
    tenthScoreButton.setPosition(144 - subPosFromLength(tenthScoreButton.getText().length()), 00);
    previousScoreButton.setPosition(144 - subPosFromLength(previousScoreString.length()), 00);
    tenthScoreButton.align(Align.left);
    previousScoreButton.align(Align.left);

    tenthLevelButton.setTransform(true);
    tenthScoreButton.setTransform(true);

    stage.addActor(group);
    group.setPosition(105, 97);

    allTheScores[1][9].setVisible(false);
    allTheScores[2][9].setVisible(false);

    group.setTransform(true);

    // Adds animation for drop and bounce then rotate and drop to 10th rank score
    if (savedStuff.isPreviousScoreInTopScore()) {
        group.setOrigin(group.getX() + group.getWidth() + 50, 10);
        group.addAction(Actions.sequence(Actions.delay(2f), Actions.delay(0.5f),
                Actions.moveBy(0, -26, 2, Interpolation.bounceOut), Actions.delay(0.1f),
                Actions.rotateBy(90f, 2f, Interpolation.bounceOut), Actions.delay(0.1f),
                Actions.moveBy(0, -120, 2, Interpolation.bounceOut)));
    }

    // Adds spaces to first score in top score table to have the same column width regardless of score size
    allTheScores[2][0].setText(fillCSWithSpaces(allTheScores[2][0].getText()));

    mainMenuButton.addListener(new ChangeListener() {
        public void changed(ChangeEvent event, Actor actor) {
            dispose();
            game.setScreen(new MainMenuScreen(game));
        }
    });

    newGameButton.addListener(new ChangeListener() {
        public void changed(ChangeEvent event, Actor actor) {
            dispose();
            game.setScreen(new GameScreen(game));
        }
    });

    // Sets correct vertical position for score just obtained
    groupPrevious.setPosition(group.getX(), group.getY() + getVerticalPosSub(savedStuff.getScoreToReplace()));
    groupPrevious.setTransform(true);

    // Score is now in position, this makes it invisible
    groupPrevious.addAction(Actions.fadeOut(0.1f));

    // Fades the score in after the bottom-most score rotates and drops
    if (savedStuff.isPreviousScoreInTopScore()) {
        groupPrevious.addAction(Actions.sequence(Actions.delay(7.5f), Actions.fadeIn(1f)));
    }
    stage.addActor(groupPrevious);

    savedStuff.setSavedGameExists(false);
    savedStuff.savePreferences();

    savedStuff.updateLevelAndScore(level, score);
    try {
        savedStuff.saveScoresToFile();
    } catch (RuntimeException ex) {
        Gdx.app.log("ERROR NAHLC", ex.getMessage());
        ex.printStackTrace();
    } catch (Exception e) {
        Gdx.app.log("ERROR NAHLC", e.getMessage());
        e.printStackTrace();
    }
    Gdx.app.log("NAHLC", "leaving create()");
}

From source file:es.eucm.ead.editor.view.builders.scene.components.TagsEditor.java

License:Open Source License

@Override
protected void buildContent() {
    countTags = 0;/*from  w w  w  .jav a 2  s  .co m*/

    tagsLayout = new LinearLayout(false);
    tagsList = Q.getComponent(controller.getModel().getGame(), TagsList.class);

    selectTag = new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            TextButton current = ((TextButton) event.getListenerActor());
            TextButton.TextButtonStyle style = current.getStyle();
            TextButton.TextButtonStyle context = skin.get(SkinConstants.STYLE_TEMPLATE,
                    TextButton.TextButtonStyle.class);
            if (style == context) {
                selectTag(current);
            } else {
                current.setStyle(context);
                controller.action(RemoveFromArray.class, tagComponent, tagComponent.getTags(),
                        current.getText().toString());
                countTags--;
            }
        }
    };

    createTag = new TextButton(i18N.m("add_tag"), skin);
    createTag.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            controller.action(CreateTag.class, TagsEditor.this);
        }
    });
    list.add(createTag);
    list.add(tagsLayout);
}

From source file:es.eucm.ead.editor.view.builders.scene.components.TagsEditor.java

License:Open Source License

private void selectTag(TextButton tagButton) {
    tagButton.setStyle(skin.get(SkinConstants.STYLE_ORANGE, TextButton.TextButtonStyle.class));
    controller.action(AddToArray.class, tagComponent, tagComponent.getTags(), tagButton.getText().toString());
    countTags++;/* w  ww .j a  v a 2 s.c  om*/
}

From source file:es.eucm.ead.engine.processors.controls.TextButtonProcessor.java

License:Open Source License

@Override
public Component getComponent(TextButton component) {
    Skin skin = gameAssets.getSkin();// www  . j  ava 2  s. c om
    TextButtonComponent button = gameLoop.createComponent(TextButtonComponent.class);
    button.setVariablesManager(variablesManager);
    button.setControl(new com.badlogic.gdx.scenes.scene2d.ui.TextButton("",
            new TextButtonStyle(skin.get(component.getStyle(), TextButtonStyle.class))));
    button.setText(gameAssets.getI18N().m(component.getText()));

    I18nTextComponent textComponent = gameLoop.createComponent(I18nTextComponent.class);
    textComponent.setI18nKey(component.getText());
    textComponent.setTextSetter(button);
    return new MultiComponent(button, textComponent);
}

From source file:net.noviden.towerdefense.Screens.GameSettingsScreen.java

License:Open Source License

public GameSettingsScreen(final TowerDefense pTowerDefense) {
    _towerDefense = pTowerDefense;//from  w  w w  .j  ava 2  s.c  om

    _modifiedKeyboardShortcutsMap = new HashMap<Integer, GameSettings.Actions>();

    _currentlySelectedActionLabel = null;
    _currentlySelectedShortcut = null;
    _previouslySelectedKey = -1;

    Skin skin = new Skin(Gdx.files.internal("assets/uiskin.json"));

    _mainStage = new Stage();

    Table rootTable = new Table();
    rootTable.setFillParent(true);

    _mainStage.addActor(rootTable);

    // set up ui elements
    Label musicVolumeLabel = new Label("Music Volume", skin);
    final Slider musicVolumeSlider = new Slider(0.0f, 1.0f, 0.1f, false, skin);
    musicVolumeSlider.setValue(GameSettings.getMusicVolume());

    Label sfxVolumeLabel = new Label("Sound Effects Volume", skin);
    final Slider sfxVolumeSlider = new Slider(0.0f, 1.0f, 0.1f, false, skin);
    sfxVolumeSlider.setValue(GameSettings.getSoundVolume());

    Table volumeTable = new Table();
    volumeTable.add(musicVolumeLabel);
    volumeTable.add(musicVolumeSlider);
    volumeTable.row();
    volumeTable.add(sfxVolumeLabel);
    volumeTable.add(sfxVolumeSlider).pad(8.0f);

    Table keyboardShortcutsTable = new Table();

    HashMap<Integer, GameSettings.Actions> currentShortcutMap = GameSettings.getShortcutMap();

    // for sorting the settings on screen
    Collection<GameSettings.Actions> values = currentShortcutMap.values();
    ArrayList<String> valueNames = new ArrayList<String>();
    for (GameSettings.Actions action : values) {
        valueNames.add(action.toString());
    }

    Collections.sort(valueNames);

    for (String s : valueNames) {
        final Label actionLabel = new Label(s, skin);
        final TextButton shortcutButton = new TextButton(
                Input.Keys.toString(GameSettings.getReverse(GameSettings.Actions.valueOf(s))), skin);

        keyboardShortcutsTable.add(actionLabel).pad(10.0f);
        keyboardShortcutsTable.add(shortcutButton);
        keyboardShortcutsTable.row();

        shortcutButton.addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {

                if (_currentlySelectedShortcut == null) {
                    _currentlySelectedActionLabel = actionLabel;
                    _currentlySelectedShortcut = shortcutButton;
                    _previouslySelectedKey = Input.Keys.valueOf(shortcutButton.getText().toString());

                    shortcutButton.setText("Press any un-set key!");
                }
            }
        });
    }

    ScrollPane keyboardShortcutsScrollPane = new ScrollPane(keyboardShortcutsTable);
    keyboardShortcutsScrollPane.layout();

    // add in save and exit buttons
    Table exitFunctionalityTable = new Table();

    TextButton saveAndExitButton = new TextButton("Save and Exit", skin);
    TextButton exitWithoutSavingButton = new TextButton("Exit Without Saving", skin);

    exitFunctionalityTable.add(saveAndExitButton).pad(10.0f);
    exitFunctionalityTable.add(exitWithoutSavingButton);

    // finally, construct display table
    rootTable.add(volumeTable);
    rootTable.row();
    rootTable.add(keyboardShortcutsScrollPane);
    rootTable.row();
    rootTable.add(exitFunctionalityTable);

    InputMultiplexer multiplexer = new InputMultiplexer(_mainStage, new MyInputProcessor());

    Gdx.input.setInputProcessor(multiplexer);

    // add in event listeners here

    exitWithoutSavingButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            _towerDefense.setScreen(new net.noviden.towerdefense.Screens.MainMenuScreen(_towerDefense));
        }
    });

    saveAndExitButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            // attempt to save settings

            GameSettings.setMusicVolume(musicVolumeSlider.getPercent());

            GameSettings.setSoundVolume(sfxVolumeSlider.getPercent());

            // save keyboard shortcuts
            GameSettings.putShortcuts(_modifiedKeyboardShortcutsMap);

            // return to main menu
            _towerDefense.setScreen(new net.noviden.towerdefense.Screens.MainMenuScreen(_towerDefense));

            dispose();
        }
    });
}