Esempio n. 1
0
//-------- Begin of function Game::run_main_menu_option --------//
//
// Run the selected game option.
//
void Game::run_main_menu_option(int optionId)
{
	if( optionId==0 )
	{
		player_profile.register_menu();
	}

	//------- Single Player Game -------//

	if( optionId==1 )
	{
		game_mode = GAME_SINGLE_PLAYER;
		single_player_menu();
	}

	//-------- Multiplayer Game ----------//

	if( optionId==2 )
	{
		game_mode = GAME_MULTI_PLAYER;
		multi_player_menu(NULL);
	}

	//----------- scenario editor -----------//

	if( optionId==3 )
	{
		// game_mode = GAME_ENCYCLOPEDIA;
		// view_encyclopedia();
#ifndef DISABLE_SCENARIO_EDITOR
		game_mode = GAME_SCENARIO_EDITOR;
		++sys.scenario_cheat_flag;
		scenario_editor_menu();
		--sys.scenario_cheat_flag;
#endif
	}

	//----------- Hall of Fame -----------//

	if( optionId==4 )
	{
		game_file_array.disp_hall_of_fame(0);
		game_file_array.disp_hall_of_fame(1);
	}

	//------------- Credits -----------//
	if( optionId==5 )
	{
		game_mode = GAME_CREDITS;
		view_credits();
	}

	if( optionId==7 )
	{
		sys.signal_exit_flag = 1;
	}
}
Esempio n. 2
0
//-------- Begin of function Game::run_main_menu_option --------//
//
// Run the selected game option.
//
void Game::run_main_menu_option(int optionId)
{
	if( optionId==0 )
	{
		player_profile.register_menu();
	}

	//------- Single Player Game -------//

	if( optionId==1 )
	{
#ifndef DISABLE_SINGLE_PLAYER
		game_mode = GAME_SINGLE_PLAYER;
		single_player_menu();
#endif
	}

	//-------- Multiplayer Game ----------//

	if( optionId==2 )
	{
#ifndef DISABLE_MULTI_PLAYER
		game_mode = GAME_MULTI_PLAYER;
		multi_player_menu(NULL);
#endif
	}

	//----------- scenario editor -----------//

	if( optionId==3 )
	{
		// game_mode = GAME_ENCYCLOPEDIA;
		// view_encyclopedia();
#ifndef DISABLE_SCENARIO_EDITOR
		game_mode = GAME_SCENARIO_EDITOR;
		++sys.scenario_cheat_flag;
		scenario_editor_menu();
		--sys.scenario_cheat_flag;
#endif
	}

	//----------- Hall of Fame -----------//

	if( optionId==4 )
	{
		game_file_array.disp_hall_of_fame(0);
		game_file_array.disp_hall_of_fame(1);
	}

	//------------- Credits -----------//
	if( optionId==5 )
	{
		game_mode = GAME_CREDITS;
		view_credits();
	}

#if 0
	if( optionId==6 )		// go to home page
	{
		const char *shortcutFilename = "7k2home.url";

		if( !misc.is_file_exist(shortcutFilename) )
		{
			// create 7k2home.url file

			char fileStr[] = "[InternetShortcut]\r\nURL=http://www.enlight.com/7k2\r\n";

			File urlFile;
			urlFile.file_create(shortcutFilename);
			urlFile.file_write( fileStr, strlen(fileStr) );
			urlFile.file_close();
		}

		if( misc.is_file_exist("7k2home.url") )
		{
			HINSTANCE hinst = ShellExecute( vga.main_hwnd, "open", shortcutFilename, NULL, "", SW_SHOWNORMAL );
		}
	}
#endif

	if( optionId==7 )
	{
		sys.signal_exit_flag = 1;
	}
}