package com.ezardlabs.lostsector.objects.menus;

import com.ezardlabs.dethsquare.Input;
import com.ezardlabs.dethsquare.Input.KeyCode;
import com.ezardlabs.dethsquare.LevelManager;

public class EscMenu extends Menu {

	public EscMenu() {
		super(new String[]{
				"Resume",
				"Settings",
				"Quit"
		}, new MenuAction[]{
				(menu, index, text) -> menu.close(),
				(menu, index, text) -> {},
				(menu, index, text) -> LevelManager.loadLevel("main_menu")
		}, false);
	}

	@Override
	public void update() {
		if (Input.getKeyDown(KeyCode.ESCAPE)) {
			toggle();
		}
		super.update();
	}
}

@@ -42,16 +42,60 @@
 menus;%0A%0A
+import com.ezardlabs.dethsquare.GameObject;%0A
 import c
@@ -222,211 +222,907 @@
 er;%0A
-%0Apublic class EscMenu extends Menu %7B%0A%0A%09public EscMenu() %7B%0A%09%09super(new String%5B%5D%7B%0A%09%09%09%09%22Resume%22,%0A%09%09%09%09%22Settings%22,%0A%09%09%09%09%22Quit%22%0A%09%09%7D, new MenuAction%5B%5D%7B%0A%09%09%09%09(menu, index, text) -%3E menu.close(),%0A%09%09%09%09(
+import com.ezardlabs.dethsquare.Vector2;%0A%0Apublic class EscMenu extends Menu %7B%0A%09private GameObject settingsMenu;%0A%0A%09@Override%0A%09public void start() %7B%0A%09%09super.start();%0A%09%09settingsMenu = GameObject.instantiate(%0A%09%09%09%09new GameObject(%22Settings Menu%22, new SettingsMenu(menu -%3E menu.gameObject.setActive(false))),%0A%09%09%09%09new Vector2());%0A%09%09settingsMenu.setActive(false);%0A%09%7D%0A%0A%09@Override%0A%09public void update() %7B%0A%09%09if (Input.getKeyDown(KeyCode.ESCAPE)) %7B%0A%09%09%09if (settingsMenu.isActiveSelf()) %7B%0A%09%09%09%09settingsMenu.setActive(false);%0A%09%09%09%7D else %7B%0A%09%09%09%09toggle();%0A%09%09%09%7D%0A%09%09%7D%0A%09%09super.update();%0A%09%7D%0A%0A%09@Override%0A%09protected String%5B%5D getOptions() %7B%0A%09%09return new String%5B%5D%7B%0A%09%09%09%09%22Resume%22,%0A%09%09%09%09%22Settings%22,%0A%09%09%09%09%22Quit%22%0A%09%09%7D;%0A%09%7D%0A%0A%09@Override%0A%09protected MenuAction%5B%5D getActions() %7B%0A%09%09return new MenuAction%5B%5D%7B%0A%09%09%09%09(menu, index, text) -%3E menu.close(),%0A%09%09%09%09new MenuAction() %7B%0A%09%09%09%09%09@Override%0A%09%09%09%09%09public void onMenuItemSelected(Menu 
 menu,
+ int
  index, 
 text
@@ -1121,18 +1121,70 @@
 ex, 
-text) -%3E %7B
+String text) %7B%0A%09%09%09%09%09%09settingsMenu.setActive(true);%0A%09%09%09%09%09%7D%0A%09%09%09%09
 %7D,%0A%09
@@ -1252,132 +1252,8 @@
 %0A%09%09%7D
-, false);%0A%09%7D%0A%0A%09@Override%0A%09public void update() %7B%0A%09%09if (Input.getKeyDown(KeyCode.ESCAPE)) %7B%0A%09%09%09toggle();%0A%09%09%7D%0A%09%09super.update()
 ;%0A%09%7D

Add settings menu