void CPlayerProfileMenu::StartMenu(void) { _pGUIM->gmPlayerProfile.gm_pmgSelectedByDefault = &gm_mgNameField; if (_gmRunningGameMode == GM_NONE || _gmRunningGameMode == GM_DEMO) { for (INDEX i = 0; i<8; i++) { gm_mgNumber[i].mg_bEnabled = TRUE; } } else { for (INDEX i = 0; i<8; i++) { gm_mgNumber[i].mg_bEnabled = FALSE; } INDEX iFirstEnabled = 0; {for (INDEX ilp = 0; ilp<4; ilp++) { CLocalPlayer &lp = _pGame->gm_lpLocalPlayers[ilp]; if (lp.lp_bActive) { gm_mgNumber[lp.lp_iPlayer].mg_bEnabled = TRUE; if (iFirstEnabled == 0) { iFirstEnabled = lp.lp_iPlayer; } } }} // backup to first player in case current player is disabled if (!gm_mgNumber[*gm_piCurrentPlayer].mg_bEnabled) *gm_piCurrentPlayer = iFirstEnabled; } // done SelectPlayer(*gm_piCurrentPlayer); CGameMenu::StartMenu(); }
// ---------------------------------------------------------------------------- //set this to force game to run in low res void DoSelectPlayer (void) { LOCALPLAYER.callsign[0] = '\0'; if (!gameData.demo.bAuto) { KeyFlush (); //now, before we bring up the register player menu, we need to //do some stuff to make sure the palette is ok. First, we need to //get our current palette into the 2d's array, so the remapping will //work. Second, we need to remap the fonts. Third, we need to fill //in part of the fade tables so the darkening of the menu edges works SelectPlayer (); //get player's name } }
//------------------------------------------------------------------------------ //returns number of item chosen int MainMenu (void) { CMenu m; int i, nChoice = 0, nOptions = 0; IpxClose (); //paletteManager.Load (MENU_PALETTE, NULL, 0, 1, 0); //get correct palette if (!LOCALPLAYER.callsign [0]) { SelectPlayer (); return 0; } if (gameData.multiplayer.autoNG.bValid) { ExecMultiMenuOption (mainOpts.nMulti); return 0; } PrintLog ("launching main menu\n"); do { nOptions = SetupMainMenu (m); // may have to change, eg, maybe selected pilot and no save games. gameStates.input.keys.xLastPressTime = TimerGetFixedSeconds (); // .. 20 seconds from now! if (nChoice < 0) nChoice = 0; gameStates.menus.bDrawCopyright = 1; i = m.Menu ("", NULL, AutoDemoMenuCheck, &nChoice, BackgroundName (BG_MENU)); if (gameStates.app.bNostalgia) gameOpts->app.nVersionFilter = 3; if (i > -1) { ExecMainMenuOption (nChoice); SavePlayerProfile (); } } while (gameStates.app.nFunctionMode == FMODE_MENU); if (gameStates.app.nFunctionMode == FMODE_GAME) paletteManager.DisableEffect (); FlushInput (); return mainOpts.nChoice; }
//================================================================================================= // NAME : UserConn_Character_Remove_Ack() // PURPOSE : Process error message. // DATE : February 5 2007 LYW // ATTENTION : //================================================================================================= void CCharSelect::UserConn_Character_Remove_Ack() { CPlayer* pPlayer = GetCurSelectedPlayer(); if(!pPlayer) { ASSERTMSG(0, CHATMGR->GetChatMsg(20)); return; } USERINFOMGR->DeleteUserQuestInfo(pPlayer->GetID()); cPushupButton * editboxName = (cPushupButton *)WINDOWMGR->GetWindowForIDEx(MT_FIRSTCHOSEBTN + m_CurSelectedPlayer); editboxName->SetText("",RGBA_MAKE(255,255,255,255),NULL,NULL); editboxName->SetPush(FALSE); m_pPlayer[m_CurSelectedPlayer] = NULL; m_CurSelectedPlayer = UINT_MAX; OBJECTMGR->AddGarbageObject(pPlayer); SelectPlayer(-1); SetDisablePick( FALSE ); // 080226 LYW --- Refresh profile dialog. CHARSELECT->GetProfileDlg()->RefreshProfile() ; }
//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; }
void CCharSelect::Process() { if( m_pDoublcClickedPlayer ) { if(Motion_SelAfterstop == m_pDoublcClickedPlayer->GetEngineObject()->GetCurMotion()) { SendMsgGetChannelInfo(); m_pDoublcClickedPlayer = NULL; } } if( WINDOWMGR->IsMouseInputProcessed() ) return; if( m_bDiablePick ) return; if( MOUSE->LButtonDoubleClick() ) { CPlayer* pPlayer = (CPlayer*)GetSelectedObjectBoneCheck( MOUSE->GetMouseEventX(), MOUSE->GetMouseEventY()); if( pPlayer && m_pDoublcClickedPlayer == NULL ) if( pPlayer == GetCurSelectedPlayer() ) { m_pDoublcClickedPlayer = pPlayer; SetDisablePick( TRUE ); } } else if( MOUSE->LButtonDown() ) { CPlayer* pPlayer = (CPlayer*)GetSelectedObjectBoneCheck( MOUSE->GetMouseEventX(), MOUSE->GetMouseEventY()); if( pPlayer && m_pDoublcClickedPlayer == NULL ) { for( int i = 0 ; i < MAX_CHARACTER_NUM ; ++i ) { if( m_pPlayer[i] == pPlayer ) { SelectPlayer( i ); break; } } } } for( int count = 0 ; count < _countof(m_pPlayer); ++count ) { if( m_pPlayer[count] ) { if( m_pPlayer[count]->GetEyeTime()->Check() == 0 ) { m_pPlayer[count]->InitializeEye() ; } } } #ifdef _GMTOOL_ if( mCameraConfiguration->Process() ) { for( DWORD i = 0; i < _countof(m_pPlayer); ++i ) { CPlayer* const player = m_pPlayer[ i ]; if( 0 == player ) { continue; } VECTOR3 position = mCameraConfiguration->GetPlayerPosition( i ); player->SetPosition( &position ); } } #endif }