package projectzombie.menu;

import projectzombie.Main;
import projectzombie.input.types.InputGUI;
import projectzombie.menu.gui.GUI;
import projectzombie.menu.gui.GUIBackToMenu;
import projectzombie.menu.gui.GUIButtonBasic;
import projectzombie.menu.gui.GUIButtonGroup;
import projectzombie.menu.gui.GUIButtonGroupPause;
import projectzombie.menu.gui.GUILabelPause;

public class MenuGamePause extends Menu
{
	private GUI gui;

	public MenuGamePause() {
		this.doGameloop = false;
		this.doGameRender = true;
		this.keepMouse = false;
		
		this.gui = new GUIBackToMenu(Main.menu);
		this.input = new InputGUI(this.gui);
		
		gui.add(new GUILabelPause("Game Paused"));
		
		GUIButtonGroup group = new GUIButtonGroupPause();
		
		group.add(new GUIButtonBasic("Save And Exit", button -> {
			saveAndQuit();
		}));
		
		gui.setSelected(group.get(0));
		gui.add(group);
	}
	
	@Override
	public void render() {
		gui.render();
	}
	
	public void saveAndQuit()
	{
		Main.world.save();
		Main.menu = new MenuSavingWorld();
	}
}
