void Game::ShowMenu() { MainMenu mainMenu; MainMenu::MenuResult result=mainMenu.Show(_mainWindow); if(result == MainMenu::Exit) { _gameState = Game::Exiting; } if(result == MainMenu::newGame) { _gameState = Game::newGame; } if(result == MainMenu::joinGame) { _gameState = Game::joinGame; } }
void Game::ShowMenu() { MainMenu mainMenu; MainMenu::MenuResult result = mainMenu.Show(_mainWindow); switch(result) { case MainMenu::Exit: _gameState = Game::Exiting; break; case MainMenu::Play1: _gameState = Game::Playing; break; } }
void Game::ShowMenu() { MainMenu mainMenu; MainMenu::MenuResult result = mainMenu.Show(_mainWindow); switch(result) { case MainMenu::Exit: _gameState = Game::Exiting; break; case MainMenu::Play: InstructionScreen instructionScreen; instructionScreen.Show(_mainWindow); ResetGame(); _gameState = Game::Playing; break; case MainMenu::Music: _gameState = Game::ShowingMenu; if(ServiceLocator::GetAudio()->IsSongPlaying()) { ServiceLocator::GetAudio()->StopAllSounds(); } break; } }
//------------------------------- DIALOG LAUNCHING --------------------------------- // // Before invoking this application one needs to open any part/empty part in NX // because of the behavior of the blocks. // // Make sure the dlx file is in one of the following locations: // 1.) From where NX session is launched // 2.) $UGII_USER_DIR/application // 3.) For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly // recommended. This variable is set to a full directory path to a file // containing a list of root directories for all custom applications. // e.g., UGII_CUSTOM_DIRECTORY_FILE=$UGII_ROOT_DIR\menus\custom_dirs.dat // // You can create the dialog using one of the following way: // // 1. USER EXIT // // 1) Create the Shared Library -- Refer "Block UI Styler programmer's guide" // 2) Invoke the Shared Library through File->Execute->NX Open menu. // //------------------------------------------------------------------------------ extern "C" DllExport void ufusr(char *param, int *retcod, int param_len) { NXCoCADTest *theNXCoCADTest = NULL; taskNum = 1; char buffer[255]; int temp; int i = 0; DWORD test = 0; ///< 0 represents the first thread HANDLE handle; DWORD numThreadId = 0; myUI = UI::GetUI(); message = myUI->NXMessageBox(); try { //theNXCoCADTest = new NXCoCADTest(); //handle = CreateThread(NULL, 0, ThreadProc, (LPVOID)&test, 0, &numThreadId); // The following method shows the dialog immediately //theNXCoCADTest->Show(); //if(bTimerEnable) //{ //KillTimer(NULL, nTimerID); //} g_timer_id = SetTimer(NULL, 0 ,2000, timer_cb); if(!Initialize()) { NXCoCADTest::theUI->NXMessageBox()->Show("Iniliazation Failed", NXOpen::NXMessageBox::DialogTypeError, "Iniliazation Failed"); return; } MainMenu *theMainMenu = NULL; theMainMenu = new MainMenu(); theMainMenu->Show(); } catch(exception& ex) { //---- Enter your exception handling code here ----- NXCoCADTest::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what()); } if (handle) { message->Show("提示",NXMessageBox::DialogTypeQuestion,"delete subThread"); CloseHandle(handle); } if(theNXCoCADTest != NULL) { delete theNXCoCADTest; theNXCoCADTest = NULL; //if(bTimerEnable) //{ // KillTimer(NULL, nTimerID); //} Terminate(); //Terminate(); } KillTimer(NULL,g_timer_id); }