package zero1hd.polyjet.ui.windows;

import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.ui.Window;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.badlogic.gdx.utils.Align;

public class NoticeWindow extends Window {
	private Label noticeText;
	private Skin skin;
	public NoticeWindow(Skin skin, String styleName, String text) {
		super("Notice", skin, "tinted");
		this.skin = skin;
		
		noticeText = new Label(text, skin, "sub-font", skin.getColor("default"));
		noticeText.setWrap(true);
		noticeText.setAlignment(Align.center);
		add(noticeText).expandX().fill().center().padLeft(20f).padRight(20f);
	}
	
	public NoticeWindow(Skin skin, String styleName, String title, String text) {
		super(title, skin, styleName);
		this.skin = skin;
		
		noticeText = new Label(text, skin, "sub-font", skin.getColor("default"));
		noticeText.setWrap(true);
		noticeText.setAlignment(Align.center);
		add(noticeText).expandX().fill().center().padLeft(20f).padRight(20f);
	}
	
	public void setupButton(String text, ChangeListener changeListener, int alignment) {
		TextButton button = new TextButton(text, skin, "sub");
		button.addListener(changeListener);
		add(button).align(alignment);
	}
	
}
