package zero1hd.rhythmbullet.desktop.screens.main;

import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;

import zero1hd.rhythmbullet.desktop.graphics.ui.components.GraphicsOptions;
import zero1hd.rhythmbullet.graphics.ui.Page;

public class GraphicsPage extends Page {
	private ScrollPane scrollPane;
	private GraphicsOptions graphicsTable;
	private TextButton backButton;
	
	public GraphicsPage(Skin skin, Preferences preferences, ChangeListener backButtonListener) {
		super(-1, 1);
		graphicsTable = new GraphicsOptions(skin, preferences);
		scrollPane = new ScrollPane(graphicsTable, skin);
		scrollPane.setFadeScrollBars(false);
		scrollPane.setFillParent(true);
		addActor(scrollPane);
		
		backButton = new TextButton("Back", skin);
		backButton.setPosition(10, getHeight() - 10 - backButton.getHeight());
		backButton.setWidth(backButton.getWidth() + 20);
		backButton.addListener(backButtonListener);
		
		addActor(backButton);
	}
	
	@Override
	public void draw(Batch batch, float parentAlpha) {
		super.draw(batch, parentAlpha);
	}
	
	@Override
	public void act(float delta) {
		super.act(delta);
	}
}
