示例#1
0
void DetailLevelMenu (void)
{
	int		i, choice = gameStates.app.nDetailLevel;
	CMenu		m (8);

	char szMenuDetails [5][20];

for (i = 0; i < 5; i++) {
	sprintf (szMenuDetails [i], "%d. %s", i + 1, MENU_DETAIL_TEXT (i));
	m.AddMenu (szMenuDetails [i], 0, HTX_ONLINE_MANUAL);
	}
m.AddText ("", 0);
m.AddMenu (MENU_DETAIL_TEXT (5), KEY_C, HTX_ONLINE_MANUAL);
m.AddCheck (TXT_HIRES_MOVIES, gameOpts->movies.bHires, KEY_S, HTX_ONLINE_MANUAL);
i = m.Menu (NULL, TXT_DETAIL_LEVEL, NULL, &choice);
if (i > -1) {
	switch (choice) {
		case 0:
		case 1:
		case 2:
		case 3:
		case 4:
			gameStates.app.nDetailLevel = choice;
			InitDetailLevels (gameStates.app.nDetailLevel);
			break;
		case 6:
			gameStates.app.nDetailLevel = 5;
			CustomDetailsMenu ();
			break;
		}
	}
gameOpts->movies.bHires = m [7].m_value;
}
示例#2
0
文件: mainmenu.cpp 项目: paud/d2x-xl
int QuitSaveLoadMenu (void)
{
	CMenu menu (5);
	int	i, choice = 0, optQuit, optOptions, optLoad, optSave;

optQuit = menu.AddMenu (TXT_QUIT_GAME, KEY_Q, HTX_QUIT_GAME);
optOptions = menu.AddMenu (TXT_GAME_OPTIONS, KEY_O, HTX_MAIN_CONF);
optLoad = menu.AddMenu (TXT_LOAD_GAME2, KEY_L, HTX_LOAD_GAME);
optSave = menu.AddMenu (TXT_SAVE_GAME2, KEY_S, HTX_SAVE_GAME);
i = menu.Menu (NULL, TXT_ABORT_GAME, NULL, &choice);
if (!i)
	return 0;
if (i == optOptions)
	ConfigMenu ();
else if (i == optLoad)
	saveGameManager.Load (1, 0, 0, NULL);
else if (i == optSave)
	saveGameManager.Save (0, 0, 0, NULL);
return 1;
}
示例#3
0
int DifficultyMenu (void)
{
	int		i, choice = gameStates.app.nDifficultyLevel;
	CMenu		m (5);

for (i = 0; i < 5; i++)
	m.AddMenu ( MENU_DIFFICULTY_TEXT (i), 0, "");
i = m.Menu (NULL, TXT_DIFFICULTY_LEVEL, NULL, &choice);
if (i <= -1)
	return 0;
if (choice != gameStates.app.nDifficultyLevel) {       
	gameStates.app.nDifficultyLevel = choice;
	SavePlayerProfile ();
	}
return 1;
}
示例#4
0
文件: mainmenu.cpp 项目: paud/d2x-xl
//------------------------------------------------------------------------------
//      Create the main menu.
int SetupMainMenu (CMenu& m)
{
memset (&mainOpts, 0xff, sizeof (mainOpts));
m.Destroy ();
m.Create (25);
#ifndef DEMO_ONLY
SetScreenMode (SCREEN_MENU);
#if 1
m.AddText ("", 0);
m.Top ()->m_bNoScroll = 1;
m.AddText ("", 0);
m.Top ()->m_bNoScroll = 1;
m.AddText ("", 0);
m.Top ()->m_bNoScroll = 1;
#endif
mainOpts.nNew = m.AddMenu (TXT_NEW_GAME1, KEY_N, HTX_MAIN_NEW);
if (!gameStates.app.bNostalgia)
	mainOpts.nSingle = m.AddMenu (TXT_NEW_SPGAME, KEY_I, HTX_MAIN_SINGLE);
mainOpts.nLoad = m.AddMenu (TXT_LOAD_GAME, KEY_L, HTX_MAIN_LOAD);
mainOpts.nMulti = m.AddMenu (TXT_MULTIPLAYER_, KEY_M, HTX_MAIN_MULTI);
if (gameStates.app.bNostalgia)
	mainOpts.nConfig = m.AddMenu (TXT_OPTIONS_, KEY_O, HTX_MAIN_CONF);
else
	mainOpts.nConfig = m.AddMenu (TXT_CONFIGURE, KEY_O, HTX_MAIN_CONF);
mainOpts.nPilots = m.AddMenu (TXT_CHANGE_PILOTS, KEY_P, HTX_MAIN_PILOT);
mainOpts.nDemo = m.AddMenu (TXT_VIEW_DEMO, KEY_D, HTX_MAIN_DEMO);
mainOpts.nScores = m.AddMenu (TXT_VIEW_SCORES, KEY_H, HTX_MAIN_SCORES);
#if 0
if (CFile::Exist ("orderd2.pcx", gameFolders.szDataDir, 0)) // SHAREWARE
	mainOpts.nOrder = m.AddMenu (TXT_ORDERING_INFO, -1, NULL);
#endif
mainOpts.nMovies = m.AddMenu (TXT_PLAY_MOVIES, KEY_V, HTX_MAIN_MOVIES);
if (!gameStates.app.bNostalgia)
	mainOpts.nSongs = m.AddMenu (TXT_PLAY_SONGS, KEY_S, HTX_MAIN_SONGS);
mainOpts.nCredits = m.AddMenu (TXT_CREDITS, KEY_C, HTX_MAIN_CREDITS);
#endif
mainOpts.nQuit = m.AddMenu (TXT_QUIT, KEY_Q, HTX_MAIN_QUIT);
return m.ToS ();
}
示例#5
0
void MultiplayerMenu (void)
{
	CMenu	m;
	int	choice = 0, i, optCreate, optJoin = -1, optConn = -1, nConnections = 0;
	int	nOldGameMode;

if ((gameStates.app.bNostalgia < 2) && gameData.multiplayer.autoNG.bValid) {
	i = MultiChoice (gameData.multiplayer.autoNG.uConnect, !gameData.multiplayer.autoNG.bHost);
	if (i >= 0)
		ExecMultiMenuOption (i);
	}
else {
	do {
		nOldGameMode = gameData.app.nGameMode;
		m.Destroy ();
		m.Create (15);
		if (gameStates.app.bNostalgia < 2) {
			optCreate = m.AddMenu (TXT_CREATE_GAME, KEY_S, HTX_NETWORK_SERVER);
			optJoin = m.AddMenu (TXT_JOIN_GAME, KEY_J, HTX_NETWORK_CLIENT);
			m.AddText ("", 0);
			optConn = m.AddRadio (TXT_NGTYPE_IPX, 0, KEY_I, HTX_NETWORK_IPX);
			m.AddRadio (TXT_NGTYPE_UDP, 0, KEY_U, HTX_NETWORK_UDP);
			m.AddRadio (TXT_NGTYPE_TRACKER, 0, KEY_T, HTX_NETWORK_TRACKER);
			m.AddRadio (TXT_NGTYPE_MCAST4, 0, KEY_M, HTX_NETWORK_MCAST);
#ifdef KALINIX
			m.AddRadio (TXT_NGTYPE_KALI, 0, KEY_K, HTX_NETWORK_KALI);
#endif
			nConnections = m.ToS ();
			m [optConn + NMCLAMP (gameStates.multi.nConnection, 0, nConnections - optConn)].m_value = 1;
			}
		else {
#ifdef NATIVE_IPX
			multiOpts.nStartIpx = m.AddMenu (TXT_START_IPX_NET_GAME,  -1, HTX_NETWORK_IPX);
			multiOpts.nJoinIpx = m.AddMenu (TXT_JOIN_IPX_NET_GAME, -1, HTX_NETWORK_IPX);
#endif //NATIVE_IPX
			multiOpts.nStartMCast4 = m.AddMenu (TXT_MULTICAST_START, KEY_M, HTX_NETWORK_MCAST);
			multiOpts.nJoinMCast4 = m.AddMenu (TXT_MULTICAST_JOIN, KEY_N, HTX_NETWORK_MCAST);
#ifdef KALINIX
			multiOpts.nStartKali = m.AddMenu (TXT_KALI_START, KEY_K, HTX_NETWORK_KALI);
			multiOpts.nJoinKali = m.AddMenu (TXT_KALI_JOIN, KEY_I, HTX_NETWORK_KALI);
#endif // KALINIX
			if (gameStates.app.bNostalgia > 2)
				multiOpts.nSerial = m.AddMenu (TXT_MODEM_GAME2, KEY_G, HTX_NETWORK_MODEM);
			}
		i = m.Menu (NULL, TXT_MULTIPLAYER, NULL, &choice);
		if (i > -1) {      
			if (gameStates.app.bNostalgia > 1)
				i = choice;
			else {
				for (gameStates.multi.nConnection = 0; 
					  gameStates.multi.nConnection < nConnections; 
					  gameStates.multi.nConnection++)
					if (m [optConn + gameStates.multi.nConnection].m_value)
						break;
				i = MultiChoice (gameStates.multi.nConnection, choice == optJoin);
				}
			ExecMultiMenuOption (i);
			}
		if (nOldGameMode != gameData.app.nGameMode)
			break;          // leave menu
		} while (i > -1);
	}
}
示例#6
0
void NewGameMenu (void)
{
	CMenu				menu;
	int				optSelMsn, optMsnName, optLevelText, optLevel, optLaunch, optLoadout;
	int				nMission = gameData.missions.nLastMission, bMsnLoaded = 0;
	int				i, choice = 0;
	char				szDifficulty [50];
	char				szLevelText [32];
	char				szLevel [5];
#if DBG
	int				optLives;
	char				szLives [5];
#endif

	static int		nPlayerMaxLevel = 1;
	static int		nLevel = 0;

if (gameStates.app.bNostalgia) {
	LegacyNewGameMenu ();
	return;
	}
gameStates.app.bD1Mission = 0;
gameStates.app.bD1Data = 0;
gameOpts->app.nVersionFilter = 3;
SetDataVersion (-1);
if (nMission < 0)
	gameFolders.szMsnSubDir [0] = '\0';
else if (gameOpts->app.bSinglePlayer) {
	if (!strstr (gameFolders.szMsnSubDir, "single/"))
		nMission = -1;
	gameFolders.szMsnSubDir [0] = '\0';
	}
hogFileManager.UseMission ("");

for (;;) {
	menu.Destroy ();
	menu.Create (15);

	optSelMsn = menu.AddMenu (TXT_SEL_MISSION, KEY_I, HTX_MULTI_MISSION);
	optMsnName = menu.AddText ((nMission < 0) ? TXT_NONE_SELECTED : gameData.missions.list [nMission].szMissionName, 0);
	if ((nMission >= 0) && (nPlayerMaxLevel > 1)) {
		sprintf (szLevelText, "%s (1-%d)", TXT_LEVEL_, nPlayerMaxLevel);
		Assert (strlen (szLevelText) < 100);
		optLevelText = menu.AddText (szLevelText, 0); 
		menu [optLevelText].m_bRebuild = 1;
		sprintf (szLevel, "%d", nLevel);
		optLevel = menu.AddInput (szLevel, 4, HTX_MULTI_LEVEL);
		}
	else
		optLevel = -1;
#if DBG
	menu.AddText ("");
	menu.AddText ("Initial Lives:");
	sprintf (szLives, "%d", gameStates.gameplay.nInitialLives);
	optLives = menu.AddInput (szLives, 4);
#endif
	menu.AddText ("                              ", 0);
	sprintf (szDifficulty + 1, TXT_DIFFICULTY2, MENU_DIFFICULTY_TEXT (gameStates.app.nDifficultyLevel));
	*szDifficulty = *(TXT_DIFFICULTY2 - 1);
	nOptDifficulty = menu.AddSlider (szDifficulty + 1, gameStates.app.nDifficultyLevel, 0, 4, KEY_D, HTX_GPLAY_DIFFICULTY);
	menu.AddText ("", 0);
	optLoadout = menu.AddMenu (TXT_LOADOUT_OPTION, KEY_B, HTX_MULTI_LOADOUT);

	if (nMission >= 0) {
		menu.AddText ("", 0);
		optLaunch = menu.AddMenu (TXT_LAUNCH_GAME, KEY_L, "");
		menu [optLaunch].m_bCentered = 1;
		}
	else
		optLaunch = -1;

	i = menu.Menu (NULL, TXT_NEWGAME_MENUTITLE, NewGameMenuCallback, &choice);
	if (i < 0) {
		SetFunctionMode (FMODE_MENU);
		return;
		}
	if (choice == optLoadout)
		LoadoutOptionsMenu ();
	else if (choice == optSelMsn) {
		i = SelectAndLoadMission (0, NULL);
		if (i >= 0) {
			bMsnLoaded = 1;
			nMission = i;
			nLevel = 1;
			PrintLog ("   getting highest level allowed to play\n");
			nPlayerMaxLevel = GetHighestLevel ();
			if (nPlayerMaxLevel > gameData.missions.nLastLevel)
				nPlayerMaxLevel = gameData.missions.nLastLevel;
			}
		}
	else if (choice == optLevel) {
		i = atoi (menu [optLevel].m_text);
#if DBG
		if (!i || (i < -gameData.missions.nSecretLevels) || (i > nPlayerMaxLevel))
#else
		if ((i <= 0) || (i > nPlayerMaxLevel))
#endif
			MsgBox (NULL, NULL, 1, TXT_OK, TXT_INVALID_LEVEL); 
		else if (nLevel == i)
			break;
		else
			nLevel = i;
		}
	else if (nMission >= 0) {
		if ((optLevel > 0) && !(nLevel = atoi (menu [optLevel].m_text))) {
			MsgBox (NULL, NULL, 1, TXT_OK, TXT_INVALID_LEVEL); 
			nLevel = 1;
			}
		else
			break;
		}
#if DBG
	else {
		i = atoi (menu [optLives].m_text);
		if (i > 0)
			gameStates.gameplay.nInitialLives = min (i, 255);
		}
#endif
	}

i = menu [nOptDifficulty].m_value;
if (gameStates.app.nDifficultyLevel != i) {
	gameStates.app.nDifficultyLevel = i;
	gameData.bosses.InitGateIntervals ();
	}
SavePlayerProfile ();

paletteManager.DisableEffect ();
if (!bMsnLoaded)
	LoadMission (nMission);
if (!StartNewGame (nLevel))
	SetFunctionMode (FMODE_MENU);
}
示例#7
0
void GameplayOptionsMenu (void)
{
	static int choice = 0;

	CMenu m;
	int	i;
	int	optSmartWeaponSwitch = -1, optHeadlightBuiltIn = -1, optHeadlightPowerDrain = -1, optNoThief = -1;
	int	optReorderPrim, optReorderSec;
	char	szSlider [50];

pszAggressivities [0] = TXT_STANDARD;
pszAggressivities [1] = TXT_MODERATE;
pszAggressivities [2] = TXT_MEDIUM;
pszAggressivities [3] = TXT_HIGH;
pszAggressivities [4] = TXT_VERY_HIGH;
pszAggressivities [5] = TXT_EXTREME;

pszWeaponSwitch [0] = TXT_NEVER;
pszWeaponSwitch [1] = TXT_WHEN_EMPTY;
pszWeaponSwitch [2] = TXT_CHOSE_BEST;

nAIAggressivity = (gameOpts->gameplay.nAIAggressivity && gameOpts->gameplay.nAIAwareness) ? 5 :  gameOpts->gameplay.nAIAggressivity;
do {
	m.Destroy ();
	m.Create (20);

	sprintf (szSlider + 1, TXT_DIFFICULTY2, MENU_DIFFICULTY_TEXT (gameStates.app.nDifficultyLevel));
	*szSlider = *(TXT_DIFFICULTY2 - 1);
	gplayOpts.nDifficulty = m.AddSlider (szSlider + 1, gameStates.app.nDifficultyLevel, 0, 4, KEY_D, HTX_GPLAY_DIFFICULTY);

	sprintf (szSlider + 1, TXT_AI_AGGRESSIVITY, pszAggressivities [nAIAggressivity]);
	*szSlider = *(TXT_AI_AGGRESSIVITY - 1);
	gplayOpts.nAIAggressivity = m.AddSlider (szSlider + 1, nAIAggressivity, 0, 5, KEY_A, HTX_AI_AGGRESSIVITY);

	sprintf (szSlider + 1, TXT_WEAPON_SWITCH, pszWeaponSwitch [gameOpts->gameplay.nAutoSelectWeapon]);
	*szSlider = *(TXT_WEAPON_SWITCH - 1);
	gplayOpts.nWeaponSwitch = m.AddSlider (szSlider + 1, gameOpts->gameplay.nAutoSelectWeapon, 0, 2, KEY_W, HTX_WEAPON_SWITCH);

	m.AddText ("", 0);
	optSmartWeaponSwitch = m.AddCheck (TXT_SMART_WPNSWITCH, extraGameInfo [0].bSmartWeaponSwitch, KEY_S, HTX_GPLAY_SMARTSWITCH);
	optHeadlightBuiltIn = m.AddCheck (TXT_HEADLIGHT_BUILTIN, extraGameInfo [0].headlight.bBuiltIn, KEY_B, HTX_HEADLIGHT_BUILTIN);
	optHeadlightPowerDrain = m.AddCheck (TXT_HEADLIGHT_POWERDRAIN, extraGameInfo [0].headlight.bDrainPower, KEY_H, HTX_HEADLIGHT_POWERDRAIN);
	optNoThief = m.AddCheck (TXT_SUPPRESS_THIEF, gameOpts->gameplay.bNoThief, KEY_T, HTX_SUPPRESS_THIEF);
	m.AddText ("");
	optReorderPrim = m.AddMenu (TXT_PRIMARY_PRIO, KEY_P, HTX_OPTIONS_PRIMPRIO);
	optReorderSec = m.AddMenu (TXT_SECONDARY_PRIO, KEY_E, HTX_OPTIONS_SECPRIO);
	for (;;) {
		if (0 > (i = m.Menu (NULL, TXT_GAMEPLAY_OPTS, GameplayOptionsCallback, &choice)))
			break;
		if (choice == optReorderPrim)
			ReorderPrimary ();
		else if (choice == optReorderSec)
			ReorderSecondary ();
		};
	} while (i == -2);
if (nAIAggressivity == 5) {
	gameOpts->gameplay.nAIAwareness = 1;
	gameOpts->gameplay.nAIAggressivity = nAIAggressivity - 1;
	}
else {
	gameOpts->gameplay.nAIAwareness = 0;
	gameOpts->gameplay.nAIAggressivity = nAIAggressivity;
	}

extraGameInfo [0].headlight.bAvailable = m [gplayOpts.nHeadlightAvailable].m_value;
extraGameInfo [0].bSmartWeaponSwitch = m [optSmartWeaponSwitch].m_value;
GET_VAL (gameOpts->gameplay.bNoThief, optNoThief);
GET_VAL (extraGameInfo [0].headlight.bDrainPower, optHeadlightPowerDrain);
GET_VAL (extraGameInfo [0].headlight.bBuiltIn, optHeadlightBuiltIn);
DefaultGameplaySettings ();
if (IsMultiGame && !COMPETITION && EGI_FLAG (bSmokeGrenades, 0, 0, 0))
	LOCALPLAYER.secondaryAmmo [PROXMINE_INDEX] = 4;
if (IsMultiGame)
	NetworkSendExtraGameInfo (NULL);
}
示例#8
0
void ConfigMenu (void)
{
	static int choice = 0;

	CMenu	menu;
	int	i;
	int	optSound, optConfig, optPerformance, optScrRes, optReorderPrim, optReorderSec, optEffects,
			optMiscellaneous, optRender, optGameplay, optCockpit, optPhysics = -1;

do {
	menu.Destroy ();
	menu.Create (20);
	optRender = optGameplay = optCockpit = -1;
	optSound = menu.AddMenu (TXT_SOUND_MUSIC, KEY_M, HTX_OPTIONS_SOUND);
	menu.AddText ("", 0);
	optConfig = menu.AddMenu (TXT_CONTROLS_, KEY_O, HTX_OPTIONS_CONFIG);
	menu.AddText ("", 0);
	if (gameStates.app.bNostalgia)
		optBrightness = menu.AddSlider (TXT_BRIGHTNESS, paletteManager.GetGamma (), 0, 16, KEY_B, HTX_RENDER_BRIGHTNESS);

	if (gameStates.app.bNostalgia)
		optPerformance = menu.AddMenu (TXT_DETAIL_LEVELS, KEY_D, HTX_OPTIONS_DETAIL);
	else
		optPerformance = -1;
	optScrRes = menu.AddMenu (TXT_SCREEN_RES, KEY_S, HTX_OPTIONS_SCRRES);
	menu.AddText ("", 0);
	if (gameStates.app.bNostalgia) {
		optReorderPrim = menu.AddMenu (TXT_PRIMARY_PRIO, KEY_P, HTX_OPTIONS_PRIMPRIO);
		optReorderSec = menu.AddMenu (TXT_SECONDARY_PRIO, KEY_E, HTX_OPTIONS_SECPRIO);
		}
	else
		optReorderPrim =
		optReorderSec = -1;
	optMiscellaneous = menu.AddMenu (gameStates.app.bNostalgia ? TXT_TOGGLES : TXT_MISCELLANEOUS, gameStates.app.bNostalgia ? KEY_T : KEY_I, HTX_OPTIONS_MISC);
	if (!gameStates.app.bNostalgia) {
		optCockpit = menu.AddMenu (TXT_COCKPIT_OPTS2, KEY_C, HTX_OPTIONS_COCKPIT);
		optRender = menu.AddMenu (TXT_RENDER_OPTS2, KEY_R, HTX_OPTIONS_RENDER);
		optEffects = menu.AddMenu (TXT_EFFECT_OPTIONS, KEY_E, HTX_RENDER_EFFECTOPTS);
#ifndef DBG
		if (gameStates.app.bGameRunning && IsMultiGame && !IsCoopGame)
			optPhysics =
			optGameplay = -1;
		else 
#endif
			{
			optGameplay = menu.AddMenu (TXT_GAMEPLAY_OPTS2, KEY_G, HTX_OPTIONS_GAMEPLAY);
			optPhysics = menu.AddMenu (TXT_PHYSICS_MENUCALL, KEY_P, HTX_OPTIONS_PHYSICS);
			}
#if 0
		optMultiThreading = menu.AddMenu (TXT_MT_MENU_OPTION, KEY_U, HTX_MULTI_THREADING);
#endif
		}

	i = menu.Menu (NULL, TXT_OPTIONS, ConfigMenuCallback, &choice);
	if (i >= 0) {
		if (i == optSound)
			SoundMenu ();
		else if (i == optConfig)
			InputDeviceConfig ();
		else if (i == optPerformance) {
			if (gameStates.app.bNostalgia)
				DetailLevelMenu ();
			}
		else if (i == optScrRes)
			ScreenResMenu ();
		else if ((optReorderPrim >= 0) && (i == optReorderPrim))
			ReorderPrimary ();
		else if ((optReorderSec >= 0) && (i == optReorderSec))
			ReorderSecondary ();
		else if (i == optMiscellaneous)
			MiscellaneousMenu ();
		else if (!gameStates.app.bNostalgia) {
			if (i == optCockpit)
				CockpitOptionsMenu ();
			else if (i == optRender)
				RenderOptionsMenu ();
			else if (i == optEffects)
				EffectOptionsMenu ();
			else if ((optGameplay >= 0) && (i == optGameplay))
				GameplayOptionsMenu ();
			else if ((optPhysics >= 0) && (i == optPhysics))
				PhysicsOptionsMenu ();
#if 0
			else if ((optMultiThreading >= 0) && (i == optMultiThreading))
				MultiThreadingOptionsMenu ();
#endif
			}
		}
	} while (i > -1);
SavePlayerProfile ();
}