src/menucode.cpp
// luaSwitchToMenu *******
// a function used for switching the current menu

luaSwitchToMenu
a function used for switching the current menu
luaSwitchToMenu a function used for switching the current menu
int luaSwitchToMenu(lua_State* lstate)
{
	char* menuName;
	int errCode;
	int paramNum=lua_gettop(lstate);
	menuName=(char*)(lua_tostring(lstate, 1));
	lstate=scriptMan.getLuaObject();
	lua_getglobal(lstate, "errorManager");
	lua_getglobal(lstate, "cpp_switchToMenu");
	lua_pushstring(lstate, menuName);
	errCode=lua_pcall(lstate, 1, 0, -3);
	lua_pop(lstate, 1);
	if (errCode!=0) {
		lua_pop(lstate,1);
		logger.logLine("Error calling pcall over cpp_switchToMenu");
		return false;
	}
	if (strcmp(menuName, "startGame_pseudoMenu")==0) {
		gameWorld.playersToStart=1;
		if (!switchToProgramZone(pgzon_actualGameRunning,
			gmzon_classicZone, 0, true)) return false;
	} else if (strcmp(menuName, "exitingMenu")==0) {
		nowObscuring=true;
	}
	return 0;
}
int luaSwitchToMenu ( lua_State * lstate ) { char * menuName ; int errCode ; int paramNum = lua_gettop ( lstate ) ; menuName = ( char * ) ( lua_tostring ( lstate , 1 ) ) ; lstate = scriptMan . getLuaObject ( ) ; lua_getglobal ( lstate , " " ) ; lua_getglobal ( lstate , " " ) ; lua_pushstring ( lstate , menuName ) ; errCode = lua_pcall ( lstate , 1 , 0 , -3 ) ; lua_pop ( lstate , 1 ) ; if ( errCode != 0 ) { lua_pop ( lstate , 1 ) ; logger . logLine ( " " ) ; return false ; } if ( strcmp ( menuName , " " ) == 0 ) { gameWorld . playersToStart = 1 ; if ( ! switchToProgramZone ( pgzon_actualGameRunning , gmzon_classicZone , 0 , true ) ) return false ; } else if ( strcmp ( menuName , " " ) == 0 ) { nowObscuring = true ; } return 0 ; }
luaSwitchToMenu 
a function used for switching the current menu
luaSwitchToMenu a function used for switching the current menu
// get the menu name...
 // execute the lua code that manages menu switching
 // take errorManager off the stack
 // there is an extra value there...
 // now check for the actions related to the different menus...
 // make it go start the game
 // let's start with only one player
 // go to the game itself
 // start obscuring all down
 // there are no return values
