package stray;

import stray.conversation.Conversations;
import stray.transition.FadeIn;
import stray.transition.FadeOut;
import stray.ui.Button;
import stray.ui.ChoiceButton;
import stray.ui.ExitButton;
import stray.ui.LanguageButton;
import stray.util.SpaceBackground;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;

public class NewGame extends Updateable {

	private ChoiceButton difficulty = new ChoiceButton((Gdx.graphics.getWidth() / 2) - 105, 64,
			210, 32, "menu.difficultyselect", new String[] { "menu.difficulty.easy",
					"menu.difficulty.normal", "menu.difficulty.hard" });

	public NewGame(Main m) {
		super(m);

		difficulty.selection = Difficulty.NORMAL_ID;

		container.elements.add(difficulty);
		container.elements.add(new Button((Gdx.graphics.getWidth() / 2) - 80, 150, 160, 32,
				"menu.start") {

			@Override
			public boolean onLeftClick() {
				main.progress.clear();
				main.progress.putInteger("difficulty", difficulty.selection);
				main.progress.flush();

				main.getPref("settings").putBoolean("saveExists", true).flush();

				Main.LEVELSELECT.offset = 0;
				Main.LEVELSELECT.wanted = 0;
				Main.LEVELSELECT.velocity = 0;

				main.transition(new FadeIn(Color.BLACK, 0.5f), new FadeOut(Color.BLACK, 0.5f),
						Main.LEVELSELECT);

				Runtime.getRuntime().gc();

				return true;
			}

		});
		container.elements.add(new ExitButton(Gdx.graphics.getWidth() - 37, Gdx.graphics
				.getHeight() - 37) {

			@Override
			public boolean onLeftClick() {
				main.setScreen(Main.MAINMENU);
				return true;
			}
		});
	}

	@Override
	public void render(float delta) {
		Gdx.gl20.glClearColor(0.909803f, 0.909803f, 0.909803f, 1);
		Gdx.gl20.glClearColor(0, 0, 0, 1);
		Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT);

		main.batch.begin();

		SpaceBackground.instance().render(main);

		main.font.setColor(Color.WHITE);
		Difficulty diff = Difficulty.get().get(difficulty.selection);
		main.drawCentered(Translator.getMsg(difficulty.choices.get(difficulty.selection))
				+ ": " + diff.damageMultiplier + "x " + Translator.getMsg("menu.difficultysummary"), Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2 - 7);

		container.render(main);
		main.font.setColor(Color.WHITE);
		main.batch.setColor(1, 1, 1, 1);

		main.batch.end();

	}

	@Override
	public void tickUpdate() {

	}

	@Override
	public void resize(int width, int height) {
	}

	@Override
	public void show() {
		difficulty.selection = Difficulty.NORMAL_ID;
	}

	@Override
	public void hide() {

	}

	@Override
	public void pause() {
	}

	@Override
	public void resume() {
	}

	@Override
	public void dispose() {
	}

	@Override
	public void renderDebug(int starting) {
	}

	@Override
	public void renderUpdate() {
	}

}

@@ -13,49 +13,8 @@
 y;%0A%0A
-import stray.conversation.Conversations;%0A
 impo
@@ -41,16 +41,16 @@
 FadeIn;%0A
+
 import s
@@ -74,16 +74,47 @@
 adeOut;%0A
+import stray.ui.BooleanButton;%0A
 import s
@@ -151,32 +151,32 @@
 i.ChoiceButton;%0A
+
 import stray.ui.
@@ -191,40 +191,8 @@
 on;%0A
-import stray.ui.LanguageButton;%0A
 impo

Test button width