<commit_before>/* <NAME>
 * 2017-05-29
 * This is the main menu window class*/
package com.surviveandthrive;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.InputListener;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle;

public class MainMenu implements Screen {

    private SpriteBatch batch;
    private Texture startBtn;
    private Skin skin;

    private Stage stage;
    private TextureAtlas atlas;
    private Table table;
    private TextButton start, exit, instructions;
    private BitmapFont white, black;
    private Label heading;

    private SurviveAndThrive game;

    public MainMenu(SurviveAndThrive game) {
        this.game = game;
    }

    @Override
    public void show() {

        stage = new Stage();
        Gdx.input.setInputProcessor(stage);

        atlas = new TextureAtlas("UI/Button.atlas");
        skin = new Skin(atlas);

        table = new Table(skin);
        table.setBounds(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());

        white = new BitmapFont(Gdx.files.internal("Fonts/MainMenuFont.fnt"), false);
        black = new BitmapFont(Gdx.files.internal("Fonts/MainMenuFontBlack.fnt"), false);

        TextButtonStyle textButtonStyle = new TextButtonStyle();

        textButtonStyle.up = skin.getDrawable("button_up.9.png");
        textButtonStyle.down = skin.getDrawable("button_down.9.png");
        textButtonStyle.pressedOffsetX = 1;
        textButtonStyle.pressedOffsetY = -1;
        textButtonStyle.font = black;

        start = new TextButton("Start", textButtonStyle);
        start.pad(20);

        exit = new TextButton("Exit", textButtonStyle);
<<<<<<< HEAD
        System.out.println(exit.getX());
        exit.setBounds(exit.getX(), exit.getY(), 150, 200);
        exit.addListener(new InputListener()
        {
            @Override
            public boolean touchDown (InputEvent event, float x, float y, int pointer, int button)
            {
                //Gdx.app.exit();
                System.out.println("tdfhgjkl");
                return true;
            }
            @Override
            public void touchUp (InputEvent event, float x, float y, int pointer, int button)
            {
                
=======
        //exit.setBounds(150, 50, 150, 200);
        exit.addListener(new ChangeListener(){
        @Override
        public void changed(ChangeEvent event, Actor actor) {
               Gdx.app.exit();
                System.out.println("fhgjbkasd");
>>>>>>> 6114c21088b577da040ed6741e7f8145e9136e9e
            }
        });

        exit.pad(15);

        exit.debug();
        exit.setPosition(250, 250);

        instructions = new TextButton("Instructions", textButtonStyle);
        instructions.pad(35);

        LabelStyle labelStyle = new LabelStyle();

        labelStyle.font = white;

        heading = new Label("Survive and Thrive", labelStyle);

        table.add(heading);
        table.row();
        table.add(start);
        table.row();<commit_msg>The instructions button is clickable<commit_after>/* <NAME>
 * 2017-05-29
 * This is the main menu window class*/
package com.surviveandthrive;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.InputListener;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle;

public class MainMenu implements Screen {

    private SpriteBatch batch;
    private Texture startBtn;
    private Skin skin;

    private Stage stage;
    private TextureAtlas atlas;
    private Table table;
    private TextButton start, exit, instructions;
    private BitmapFont white, black;
    private Label heading;

    private SurviveAndThrive game;

    public MainMenu(SurviveAndThrive game) {
        this.game = game;
    }

    @Override
    public void show() {
        
        stage = new Stage();
        Gdx.input.setInputProcessor(stage);

        atlas = new TextureAtlas("UI/Button.atlas");
        skin = new Skin(atlas);

        table = new Table(skin);
        table.setBounds(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
        
        white = new BitmapFont(Gdx.files.internal("Fonts/MainMenuFont.fnt"), false);
        black = new BitmapFont(Gdx.files.internal("Fonts/MainMenuFontBlack.fnt"), false);

        TextButtonStyle textButtonStyle = new TextButtonStyle();

        textButtonStyle.up = skin.getDrawable("button_up.9.png");
        textButtonStyle.down = skin.getDrawable("button_down.9.png");
        textButtonStyle.pressedOffsetX = 1;
        textButtonStyle.pressedOffsetY = -1;
        textButtonStyle.font = black;

        start = new TextButton("Start", textButtonStyle);
        start.pad(20);

        exit = new TextButton("Exit", textButtonStyle);
        exit.setBounds(200, 125, 0, 0);
        exit.addListener(new InputListener()
        {
            @Override
            public boolean touchDown (InputEvent event, float x, float y, int pointer, int button)
            {
                Gdx.app.exit();
                return true;
            }
            @Override
            public void touchUp (InputEvent event, float x, float y, int pointer, int button)
            {
                
            }
        });

        exit.pad(15);
        exit.debug();

        instructions = new TextButton("Instructions", textButtonStyle);
        instructions.setBounds(100, 180, 300, 100);
        instructions.debug();
        instructions.addListener(new InputListener()
        {
            @Override
            public boolean touchDown (InputEvent event, float x, float y, int pointer, int button)
            {
                System.out.println("//TODO add instructions");
                return true;
            }
            @Override
            public void touchUp (InputEvent event, float x, float y, int pointer, int button)
            {
                
            }
        });
        
        instructions.pad(35);

        LabelStyle labelStyle = new LabelStyle();

        labelStyle.font = white;

        heading = new Label("Survive and Thrive", labelStyle);

        table.add(heading);
        table.row();
        table.add(start);
        table.row();
{'fraction_non_alphanumeric': 0.11000134970981239, 'fraction_numerical': 0.018895937373464705, 'mean_word_length': 2.526891956211328, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1204237', 'n_tokens_mistral': 2371, 'n_tokens_neox': 2208, 'n_words': 462}