コード例 #1
0
ファイル: gameplaymenu.cpp プロジェクト: paud/d2x-xl
void LoadoutOptionsMenu (void)
{
	static int choice = 0;

	CMenu	m (25);
	int	i, nOptions = 0;

m.AddText (TXT_GUN_LOADOUT, 0);
optGuns = m.ToS ();
for (i = 0; i < (int) sizeofa (pszGuns); i++, nOptions++)
	m.AddCheck (pszGuns [i], (extraGameInfo [0].loadout.nGuns & (1 << i)) != 0, 0, HTX_GUN_LOADOUT);
m.AddText ("", 0);
m.AddText (TXT_DEVICE_LOADOUT, 0);
optDevices = m.ToS ();
for (i = 0; i < (int) sizeofa (pszDevices); i++, nOptions++)
	m.AddCheck (pszDevices [i], (extraGameInfo [0].loadout.nDevice & (nDeviceFlags [i])) != 0, 0, HTX_DEVICE_LOADOUT);
do {
	i = m.Menu (NULL, TXT_LOADOUT_MENUTITLE, LoadoutCallback, &choice);
	} while (i != -1);
extraGameInfo [0].loadout.nGuns = 0;
for (i = 0; i < (int) sizeofa (pszGuns); i++) {
	if (m [optGuns + i].m_value)
		extraGameInfo [0].loadout.nGuns |= (1 << i);
	}
extraGameInfo [0].loadout.nDevice = 0;
for (i = 0; i < (int) sizeofa (pszDevices); i++) {
	if (m [optDevices + i].m_value)
		extraGameInfo [0].loadout.nDevice |= nDeviceFlags [i];
	}
AddPlayerLoadout ();
}
コード例 #2
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 ();
}
コード例 #3
0
ファイル: newgamemenu.cpp プロジェクト: paud/d2x-xl
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);
	}
}