// Path: core/src/com/mygdx/game/settings/GameSettings.java
// public class GameSettings {
// 
// 	public static final float CAMERA_FOV = 60;
// 	public static final float CAMERA_FAR = 100f;
// 	public static final float CAMERA_NEAR = 0.1f;
// 	public static final float CAMERA_MAX_PAN_VELOCITY = 50;
// 	public static final float CAMERA_MIN_ZOOM = 1;
// 	public static final float CAMERA_ZOOM_STEP = 4;
// 	public static final float CAMERA_MAX_ZOOM = 40;
// 	public static final float CAMERA_LERP_ALPHA = 5f;
// 
// 	public static final float CAMERA_PICK_RAY_DST = 100;
// 
// 	public static final float SCENE_AMBIENT_LIGHT = 0.1f;
// 
// 	public static final Vector3 GRAVITY = new Vector3(0, -9.8f, 0);
// 
// 	public static final int SHADOW_MAP_WIDTH = 2048;
// 	public static final int SHADOW_MAP_HEIGHT = 2048;
// 	public static final float SHADOW_VIEWPORT_HEIGHT = 100;
// 	public static final float SHADOW_VIEWPORT_WIDTH = 100;
// 	public static final float SHADOW_NEAR = 1;
// 	public static final float SHADOW_FAR = 100;
// 	public static final float SHADOW_INTENSITY = 1f;
// 
// 	public static float GAME_SPEED = 1;
// 	public static float GAME_SPEED_PAUSE = 0;
// 	public static float GAME_SPEED_PLAY = 1;
// 	public static float GAME_SPEED_SLOW = 0.05f;
// 
// 	public static float MOUSE_SENSITIVITY = 0.1f;
// 	public static float MOUSE_DRAG_THRESHOLD = 10f;
// 
// 	public static int KEY_PAUSE = Input.Keys.SPACE;
// 	public static int KEY_PAN_FORWARD = Input.Keys.W;
// 	public static int KEY_PAN_LEFT = Input.Keys.A;
// 	public static int KEY_PAN_BACKWARD = Input.Keys.S;
// 	public static int KEY_PAN_RIGHT = Input.Keys.D;
// 
// 	public static float SOUND_VOLUME = 1f;
// 	public static float MUSIC_VOLUME = 1f;
// }


import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.ImageButton;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import com.mygdx.game.settings.GameSettings;
/*******************************************************************************
 * Copyright 2015 See AUTHORS file.
 * <p/>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p/>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p/>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/

package com.mygdx.game.ui;


/**
 * @author jsjolund
 */
public class GameSpeedController extends Table {

	private final ImageButton imageButton;
	private final ImageButton.ImageButtonStyle btnPauseStyle;
	private final ImageButton.ImageButtonStyle btnPlayStyle;
	private final ImageButton.ImageButtonStyle btnSlowStyle;

	public GameSpeedController(TextureAtlas buttonAtlas) {
		btnPauseStyle = new ImageButton.ImageButtonStyle();
		btnPauseStyle.up = new TextureRegionDrawable(buttonAtlas.findRegion("pause-up"));
		btnPauseStyle.down = new TextureRegionDrawable(buttonAtlas.findRegion("pause-down"));

		btnPlayStyle = new ImageButton.ImageButtonStyle();
		btnPlayStyle.up = new TextureRegionDrawable(buttonAtlas.findRegion("play-up"));
		btnPlayStyle.down = new TextureRegionDrawable(buttonAtlas.findRegion("play-down"));

		btnSlowStyle = new ImageButton.ImageButtonStyle();
		btnSlowStyle.up = new TextureRegionDrawable(buttonAtlas.findRegion("slow-up"));
		btnSlowStyle.down = new TextureRegionDrawable(buttonAtlas.findRegion("slow-down"));

		imageButton = new ImageButton(btnPauseStyle);

		add(imageButton);

		imageButton.addListener(new ChangeListener() {
			@Override
			public void changed(ChangeEvent event, Actor actor) {
				setGameSpeed();
				event.cancel();
			}
		});
	}

	public void setGameSpeed() {
// Path: core/src/com/mygdx/game/settings/GameSettings.java
// public class GameSettings {
// 
// 	public static final float CAMERA_FOV = 60;
// 	public static final float CAMERA_FAR = 100f;
// 	public static final float CAMERA_NEAR = 0.1f;
// 	public static final float CAMERA_MAX_PAN_VELOCITY = 50;
// 	public static final float CAMERA_MIN_ZOOM = 1;
// 	public static final float CAMERA_ZOOM_STEP = 4;
// 	public static final float CAMERA_MAX_ZOOM = 40;
// 	public static final float CAMERA_LERP_ALPHA = 5f;
// 
// 	public static final float CAMERA_PICK_RAY_DST = 100;
// 
// 	public static final float SCENE_AMBIENT_LIGHT = 0.1f;
// 
// 	public static final Vector3 GRAVITY = new Vector3(0, -9.8f, 0);
// 
// 	public static final int SHADOW_MAP_WIDTH = 2048;
// 	public static final int SHADOW_MAP_HEIGHT = 2048;
// 	public static final float SHADOW_VIEWPORT_HEIGHT = 100;
// 	public static final float SHADOW_VIEWPORT_WIDTH = 100;
// 	public static final float SHADOW_NEAR = 1;
// 	public static final float SHADOW_FAR = 100;
// 	public static final float SHADOW_INTENSITY = 1f;
// 
// 	public static float GAME_SPEED = 1;
// 	public static float GAME_SPEED_PAUSE = 0;
// 	public static float GAME_SPEED_PLAY = 1;
// 	public static float GAME_SPEED_SLOW = 0.05f;
// 
// 	public static float MOUSE_SENSITIVITY = 0.1f;
// 	public static float MOUSE_DRAG_THRESHOLD = 10f;
// 
// 	public static int KEY_PAUSE = Input.Keys.SPACE;
// 	public static int KEY_PAN_FORWARD = Input.Keys.W;
// 	public static int KEY_PAN_LEFT = Input.Keys.A;
// 	public static int KEY_PAN_BACKWARD = Input.Keys.S;
// 	public static int KEY_PAN_RIGHT = Input.Keys.D;
// 
// 	public static float SOUND_VOLUME = 1f;
// 	public static float MUSIC_VOLUME = 1f;
// }


// Path: core/src/com/mygdx/game/ui/GameSpeedController.java
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.ImageButton;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import com.mygdx.game.settings.GameSettings;

/*******************************************************************************
 * Copyright 2015 See AUTHORS file.
 * <p/>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p/>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p/>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/

package com.mygdx.game.ui;


/**
 * @author jsjolund
 */
public class GameSpeedController extends Table {

	private final ImageButton imageButton;
	private final ImageButton.ImageButtonStyle btnPauseStyle;
	private final ImageButton.ImageButtonStyle btnPlayStyle;
	private final ImageButton.ImageButtonStyle btnSlowStyle;

	public GameSpeedController(TextureAtlas buttonAtlas) {
		btnPauseStyle = new ImageButton.ImageButtonStyle();
		btnPauseStyle.up = new TextureRegionDrawable(buttonAtlas.findRegion("pause-up"));
		btnPauseStyle.down = new TextureRegionDrawable(buttonAtlas.findRegion("pause-down"));

		btnPlayStyle = new ImageButton.ImageButtonStyle();
		btnPlayStyle.up = new TextureRegionDrawable(buttonAtlas.findRegion("play-up"));
		btnPlayStyle.down = new TextureRegionDrawable(buttonAtlas.findRegion("play-down"));

		btnSlowStyle = new ImageButton.ImageButtonStyle();
		btnSlowStyle.up = new TextureRegionDrawable(buttonAtlas.findRegion("slow-up"));
		btnSlowStyle.down = new TextureRegionDrawable(buttonAtlas.findRegion("slow-down"));

		imageButton = new ImageButton(btnPauseStyle);

		add(imageButton);

		imageButton.addListener(new ChangeListener() {
			@Override
			public void changed(ChangeEvent event, Actor actor) {
				setGameSpeed();
				event.cancel();
			}
		});
	}

	public void setGameSpeed() {
		if (GameSettings.GAME_SPEED == GameSettings.GAME_SPEED_PLAY) {