/// @param menu_id

var _id = argument[0];

menu_button_cur = noone;
with(obj_menu_par)
	instance_destroy();

var _center = 50;

switch(_id) {
case MENU.NOONE:
	// just closing all menu things
	break;
case MENU.PAUSE:
	sc_button_create(BUTTON.CONTINUE, _center, 30, "CONTINUE");
	sc_button_create(BUTTON.SETTINGS, _center, 50, "SETTINGS");
	sc_button_create(BUTTON.EXIT_TO_MENU, _center, 70, "MENU");
	break;
case MENU.MAIN:
	sc_button_create(BUTTON.PLAY, _center, 30, "PLAY");
	sc_button_create(BUTTON.SETTINGS, _center, 50, "SETTINGS");
	sc_button_create(BUTTON.QUIT, _center, 70, "QUIT");
	break;
case MENU.SELECT_LEVEL:
	sc_button_create(BUTTON.START, 70, 85, "START");
	sc_button_create(BUTTON.BACK_TO_MENU, 30, 85, "BACK");
	for(var i = 0; i < 2; i++) {
		for (var j = 0; j < 6; j++) {
			var _get = (i*6)+(j+1);
			var _text;
			if (_get <= array_length_1d(global.levels))
				_text = string_upper(global.levels[_get - 1]);
			else
				_text = "USER" + string(_get);
			sc_level_select_create(_get, _center+i*40-20, 20 + j*10, _text);
		}
	}
	
	break;
case MENU.SETTINGS:
	sc_button_create(BUTTON.BACK_TO_MENU, 20, 80, "BACK");
	sc_slider_create(SLIDER.SOUND, _center, 30, "SOUND");
	sc_slider_create(SLIDER.MUSIC, _center, 50, "MUSIC");
	break;
}
if (_id != MENU.NOONE) {
	menu_button_cur = instance_nearest(room_width/2, 0, obj_menu_par);
}