Пример #1
0
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;
}
Пример #2
0
//------------------------------------------------------------------------------
//this is for system-level keys, such as help, etc.
//returns 1 if screen changed
int HandleSystemKey (int key)
{
	int bScreenChanged = 0;
	int bStopPlayerMovement = 1;

	//if (gameStates.gameplay.bSpeedBoost)
	//	return 0;

if (!gameStates.app.bPlayerIsDead)
	switch (key) {
		case KEY_ESC:
			if (gameData.app.bGamePaused)
				gameData.app.bGamePaused = 0;
			else {
				gameStates.app.bGameAborted = 1;
				SetFunctionMode (FMODE_MENU);
			}
			break;

		case KEY_SHIFTED + KEY_F1:
			bScreenChanged = SelectNextWindowFunction (0);
			break;
		case KEY_SHIFTED + KEY_F2:
			bScreenChanged = SelectNextWindowFunction (1);
			break;
		case KEY_SHIFTED + KEY_F3:
			gameOpts->render.cockpit.nWindowSize = (gameOpts->render.cockpit.nWindowSize + 1) % 4;
			bScreenChanged = 1; //SelectNextWindowFunction(1);
			break;
		case KEY_CTRLED + KEY_F3:
			gameOpts->render.cockpit.nWindowPos = (gameOpts->render.cockpit.nWindowPos + 1) % 6;
			bScreenChanged = 1; //SelectNextWindowFunction(1);
			break;
		case KEY_SHIFTED + KEY_CTRLED + KEY_F3:
			gameOpts->render.cockpit.nWindowZoom = (gameOpts->render.cockpit.nWindowZoom + 1) % 4;
			bScreenChanged = 1; //SelectNextWindowFunction(1);
			break;
		}

if (!gameStates.app.bPlayerIsDead || (LOCALPLAYER.lives > 1)) {
	switch (key) {
/*
		case KEY_SHIFTED + KEY_ESC:
			console.Show ();
			break;
*/
		case KEY_COMMAND + KEY_P:
		case KEY_CTRLED + KEY_P:
		case KEY_PAUSE:
			DoGamePause ();
			break;

		case KEY_CTRLED + KEY_ALTED + KEY_S:
			if (!ToggleFreeCam ())
				return 0;
			break;

		case KEY_COMMAND + KEY_SHIFTED + KEY_P:
		case KEY_PRINT_SCREEN:
			gameStates.app.bSaveScreenshot = 1;
			SaveScreenShot (NULL, 0);
			break;

		case KEY_F1:
			ShowHelp ();
			break;

		case KEY_F2:					//gameStates.app.bConfigMenu = 1; break;
			if (!IsMultiGame) {
				paletteManager.SaveEffect ();
				paletteManager.ResetEffect ();
				paletteManager.LoadEffect ();
				}
			ConfigMenu ();
			if (!IsMultiGame)
				paletteManager.LoadEffect ();
			break;

		case KEY_F3:
			if (!GuidedInMainView ()) {
				SetFreeCam (0);
				SetChaseCam (0);
				cockpit->Toggle ();
				bScreenChanged = 1;
				}
			break;

		case KEY_F7 + KEY_SHIFTED:
			paletteManager.SaveEffect ();
			JoyDefsCalibrate ();
			paletteManager.LoadEffect ();
			break;

		case KEY_SHIFTED + KEY_MINUS:
		case KEY_MINUS:
			ShrinkWindow ();
			bScreenChanged = 1;
			break;

		case KEY_SHIFTED + KEY_EQUALS:
		case KEY_EQUALS:
			GrowWindow ();
			bScreenChanged = 1;
			break;

		case KEY_CTRLED + KEY_F5:
			saveGameManager.Save (0, 0, 1, 0);
			break;

		case KEY_CTRLED + KEY_F9:
			saveGameManager.Load (0, 0, 1, 0);
			break;

		case KEY_F5:
			if (gameData.demo.nState == ND_STATE_RECORDING) {
				NDStopRecording ();
				}
			else if (gameData.demo.nState == ND_STATE_NORMAL)
				if (!gameData.app.bGamePaused)		//can't start demo while paused
					NDStartRecording ();
			break;

		case KEY_ALTED + KEY_F4:
			gameData.multigame.bShowReticleName = (gameData.multigame.bShowReticleName + 1) % 2;

		case KEY_F7:
			gameData.multigame.kills.bShowList = (gameData.multigame.kills.bShowList + 1) % (IsTeamGame ? 4 : 3);
			if (IsMultiGame)
				MultiSortKillList ();
			bStopPlayerMovement = 0;
			break;

		case KEY_CTRLED + KEY_F7:
			if ((gameStates.render.cockpit.bShowPingStats = !gameStates.render.cockpit.bShowPingStats))
				ResetPingStats ();
			break;

		case KEY_CTRLED + KEY_F8:
			gameData.stats.nDisplayMode = (gameData.stats.nDisplayMode + 1) % 5;
			gameOpts->render.cockpit.bPlayerStats = gameData.stats.nDisplayMode != 0;
			break;

		case KEY_F8:
			MultiSendMsgStart (-1);
			bStopPlayerMovement = 0;
			break;

		case KEY_F9:
		case KEY_F10:
		case KEY_F11:
		case KEY_F12:
			MultiSendMacro (key);
			bStopPlayerMovement = 0;
			break;		// send taunt macros

		case KEY_CTRLED + KEY_F12:
			gameData.trackIR.x =
			gameData.trackIR.y = 0;
			break;

		case KEY_ALTED + KEY_F12:
			if (!ToggleChaseCam ())
				return 0;
			break;

		case KEY_SHIFTED + KEY_F9:
		case KEY_SHIFTED + KEY_F10:
		case KEY_SHIFTED + KEY_F11:
		case KEY_SHIFTED + KEY_F12:
			MultiDefineMacro (key);
			bStopPlayerMovement = 0;
			break;		// redefine taunt macros

		case KEY_ALTED + KEY_F2:
			if (!gameStates.app.bPlayerIsDead && !(IsMultiGame && !IsCoopGame)) {
				paletteManager.SaveEffectAndReset ();
				paletteManager.SetEffect (); // get only the effect color back
				saveGameManager.Save (0, 0, 0, NULL);
				paletteManager.LoadEffect ();
			}
			break;  // 0 means not between levels.

		case KEY_ALTED + KEY_F3:
			if (!gameStates.app.bPlayerIsDead && (!IsMultiGame || IsCoopGame)) {
				paletteManager.SaveEffectAndReset ();
				saveGameManager.Load (1, 0, 0, NULL);
				if (gameData.app.bGamePaused)
					DoGamePause ();
			}
			break;


		case KEY_F4 + KEY_SHIFTED:
			if (!gameStates.app.bD1Mission)
				DoEscortMenu ();
			break;


		case KEY_F4 + KEY_SHIFTED + KEY_ALTED:
			if (!gameStates.app.bD1Mission)
				ChangeGuidebotName ();
			break;

		case KEY_MINUS + KEY_ALTED:
			songManager.Prev ();
			break;

		case KEY_EQUALS + KEY_ALTED:
			songManager.Next ();
			break;

	//added 8/23/99 by Matt Mueller for hot key res/fullscreen changing, and menu access
		case KEY_CTRLED + KEY_SHIFTED + KEY_PADDIVIDE:
		case KEY_ALTED + KEY_CTRLED + KEY_PADDIVIDE:
		case KEY_ALTED + KEY_SHIFTED + KEY_PADDIVIDE:
			RenderOptionsMenu ();
			break;

		case KEY_CTRLED + KEY_F1:
			SwitchDisplayMode (-1);
			break;
		case KEY_CTRLED + KEY_F2:
			SwitchDisplayMode (1);
			break;

		case KEY_ALTED + KEY_ENTER:
		case KEY_ALTED + KEY_PADENTER:
			GrToggleFullScreenGame ();
			break;

		default:
				return bScreenChanged;
		}	 //switch (key)
	}

if (bStopPlayerMovement) {
	StopPlayerMovement ();
	gameStates.app.bEnterGame = 2;
	}
return bScreenChanged;
}
Пример #3
0
//returns flag, true means quit menu
int ExecMainMenuOption (int nChoice) 
{
	CFileSelector	fs;

if (nChoice == mainOpts.nNew) {
	gameOpts->app.bSinglePlayer = 0;
	NewGameMenu ();
	}
else if (nChoice == mainOpts.nSingle) {
	gameOpts->app.bSinglePlayer = 1;
	NewGameMenu ();
	}
else if (nChoice == mainOpts.nLoad) {
	if (!saveGameManager.Load (0, 0, 0, NULL))
		SetFunctionMode (FMODE_MENU);
	}
#if DBG
else if (nChoice == mainOpts.nLoadDirect) {
	CMenu	m (1);
	char	szLevel [10] = "";
	int	nLevel;

	m.AddInput (szLevel, sizeof (szLevel), NULL);
	m.Menu (NULL, "Enter level to load", NULL, NULL);
	nLevel = atoi (m [0].m_text);
	if (nLevel && (nLevel >= gameData.missions.nLastSecretLevel) && (nLevel <= gameData.missions.nLastLevel)) {
		paletteManager.DisableEffect ();
		StartNewGame (nLevel);
		}
	}
#endif
else if (nChoice == mainOpts.nMulti)
		MultiplayerMenu ();
else if (nChoice == mainOpts.nConfig) 
	ConfigMenu ();
else if (nChoice == mainOpts.nPilots) {
	gameStates.gfx.bOverride = 0;
	SelectPlayer ();
	}
else if (nChoice == mainOpts.nDemo) {
	char demoPath [FILENAME_LEN], demoFile [FILENAME_LEN];

	sprintf (demoPath, "%s%s*.dem", gameFolders.szDemoDir, *gameFolders.szDemoDir ? "/" : ""); 
	if (fs.FileSelector (TXT_SELECT_DEMO, demoPath, demoFile, 1))
		NDStartPlayback (demoFile);
	}
else if (nChoice == mainOpts.nScores) {
	paletteManager.DisableEffect ();
	ScoresView (-1);
	}
else if (nChoice == mainOpts.nMovies)
	PlayMenuMovie ();
else if (nChoice == mainOpts.nSongs)
	PlayMenuSong ();
else if (nChoice == mainOpts.nCredits) {
	paletteManager.DisableEffect ();
	songManager.StopAll ();
	creditsManager.Show (NULL); 
	}
else if (nChoice == mainOpts.nHelp) 
	ShowHelp ();
else if (nChoice == mainOpts.nQuit) {
	paletteManager.DisableEffect ();
	SetFunctionMode (FMODE_EXIT);
	}
else if (nChoice == mainOpts.nOrder) 
	ShowOrderForm ();
else
	return 0;
return 1;
}
Пример #4
0
BOOLEAN AdminMenu(void)
{
  int select = 0;

  while(TRUE)
  {
    select = MenuSelect(&KAdminMenu, select);
    if (select == -1)
      return FALSE;

    switch (select)
    {
      case 1:
        if( gUsers_tbl.b_type == KESPECIALISTA )
        {
          MsgError("ACCESO DENEGADO");
          break;
        }
        MenuComprobante();
        break;

      case 2:
        if( gUsers_tbl.b_type == KESPECIALISTA )
        {
          MsgError("ACCESO DENEGADO");
          break;
        }
        MenuInformes();
        break;

      case 3:
	   if( gUsers_tbl.b_type == KOPERADOR )
        {
          MsgError("ACCESO DENEGADO");
          break;
        }

        ConfigMenu();
        break;

      case 4:
        if( gUsers_tbl.b_type == KESPECIALISTA )
        {
          MsgError("ACCESO DENEGADO");
          break;
        }
		 if( gUsers_tbl.b_type == KOPERADOR )
        {
          MsgError("ACCESO DENEGADO");
          break;
        }

        SrvEthMenu();
        break;

      case 5:
        if( gUsers_tbl.b_type == KESPECIALISTA )
        {
          MsgError("ACCESO DENEGADO");
          break;
        }
		 if( gUsers_tbl.b_type == KOPERADOR )
        {
          MsgError("ACCESO DENEGADO");
          break;
        }

        IccTmkInject();
        break;

      case 6:
        if( gUsers_tbl.b_type == KESPECIALISTA )
        {
          MsgError("ACCESO DENEGADO");
          break;
        }
        OtrosMenu();
        break;
    }
  }
  return TRUE;
}