void GameManager::doNetwork() { std::vector<NetworkEvent>& packets = network.getPackets(); for (std::vector<NetworkEvent>::iterator it = packets.begin(); it != packets.end(); ++it) { table.execute(*it); } packets.clear(); network.sendPackets(table.getMovement()); table.getMovement().clear(); if (!network.getSuccess()) { Msgbox("Hálózati probléma", view, input); input.setRun(false); } }
Project_Pull_Menu() { int index = 1; char ch; Project_menu(0); do{ _setcursortype(_NOCURSOR); ch = getch(); if(ch == char(0)) ch = getch(); switch(ch){ case char( 6) : //ctrl-f case char( 3) : //ctrl-c case char(19) : //ctrl-s case char(75) : Fore_Ground_window(); active_status_bar(6,1); MAINMENU(5); break; case char(27) : Fore_Ground_window(); active_status_bar(6,1); MAINMENU(6); break; case char(77) : active_status_bar(6,1); //PROGRAMMER MAINMENU(7); //---------> break; //==================================== case char(72) : index = (index == 1) ? Project_Size1 : index-1;break; case char(80) : index = (index == Project_Size1) ? 1 : index+1;break; case char(13) : switch(index){ case 1 : _setcursortype(_NORMALCURSOR); EN_1(); //K_EN(); //system("c:\\caeser_e.exe"); //MSGENCIPHER(); break; case 2 : _setcursortype(_NORMALCURSOR); DN_1(); //K_DN(); //system("c:\\caeser_d.exe"); //MSGDECIPHER(); break; case 3 : _setcursortype(_NORMALCURSOR); Msgbox(); return 0; } } active_status_bar(index-1,6); // Project_menu(index-1); } while ( ch != 13 || ch != 27 || ch != 6 || ch != 3 || ch != 19 || ch != 27 ); return 0; }
//````````````````````````````````````````````````````````` void File_Pull_Menu() { int index = 1; char ch; File_menu(0); do{ _setcursortype(_NOCURSOR); ch = getch(); if(ch == char(0)) ch = getch(); switch(ch){ case char(16) : break; //ctrl-p case char( 3) : break; //ctrl-c case char(19) : break; //ctrl-s case char(75) : active_status_bar(0,1); //<-------- MAINMENU(1); break; case char(77) : //---------> Fore_Ground_window(); active_status_bar(0,3); menu(list_Cap,list,size,2); PROGRAMMER_Pull_Menu(); break; case char(27) : active_status_bar(1,1); //FILE MAINMENU(2); //FILE break; //==================================== case char(72) : index = (index == 1) ? File_Size1 : index-1;break; // up case char(80) : index = (index == File_Size1) ? 1 : index+1;break; //down case char(13) : switch(index){ case 1 : _setcursortype(_NORMALCURSOR); //dir DIRR(); active_status_bar(1,1); // MAINMENU(2); case 2 : _setcursortype(_NORMALCURSOR); BIOS1(); //CHECK BIOS active_status_bar(1,1); // MAINMENU(2); case 3 : _setcursortype(_NORMALCURSOR); SAVE(); active_status_bar(1,1); // MAINMENU(2); break; case 4 : _setcursortype(_NORMALCURSOR); CHANGE_DIR(); active_status_bar(1,1); // MAINMENU(2); break; case 5 : _setcursortype(_NORMALCURSOR); DEL1(1); active_status_bar(1,1); // MAINMENU(2); break; case 6 : _setcursortype(_NORMALCURSOR); DEL1(2); active_status_bar(1,1); // MAINMENU(2);break; case 7 : _setcursortype(_NORMALCURSOR); active_status_bar(1,1); // MAINMENU(2); break; case 8 : _setcursortype(_NORMALCURSOR); Msgbox(); exit(0);break; } } active_status_bar(index-1,2); // File_menu(index-1); } while ( ch != 13 || ch != 27 || ch != 6 || ch != 3 || ch != 19 || ch != 27 ); }
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //POPUP MENU Popup_Menu() { int index = 1; char ch; active_status_bar(0,5); Popup_menu(0); do{ _setcursortype(_NOCURSOR); ch = getch(); if(ch == char(0)) ch = getch(); switch(ch){ case char( 6) : //ctrl-f case char( 3) : //ctrl-c case char(19) : //ctrl-s case char(75) : active_status_bar(0,1); MAINMENU(1); case char(77) : Fore_Ground_window(); active_status_bar(0,3); menu(list_Cap,list,size,2); //menu(2); PROGRAMMER_Pull_Menu(); case char(27) : MAINMENU(1); //==================================== case char(72) : index = (index == 1) ? File_Size1 : index-1;break; case char(80) : index = (index == Popup_Size1) ? 1 : index+1;break; case char(13) : switch(index){ case 1 : _setcursortype(_NORMALCURSOR); K_EN(); break; case 2 : _setcursortype(_NORMALCURSOR); K_DN(); break; case 3 : _setcursortype(_NORMALCURSOR); Msgbox(); return 0; } } active_status_bar(index-1,5); // Popup_menu(index-1); } while ( ch != 13 || ch != 27 || ch != 6 || ch != 3 || ch != 19 || ch != 27 ); return 0; }
//**************************************************************************** // MAINMENU_FUN START HERE //**************************************************************************** void MAINMENU(int s) { int index = s; //'s' is USED for identifying parameter for MENU_INDEX char ch; //'ch' id USED for TEMP_VAR while reading command Window(1,2,80,22,1); //CREAT BLUE SCREEN Splash(); //SPLASH SCREEN Window(1,1,80,1,LIGHTGRAY);//CREAT LIGHT GRAY SCREEN textcolor(BLACK); //MAKE TEXT_COLOR BLACK menu(list_Cap,list,size,index-1); //CALL FUN_MENU With (Index-1) do{ _setcursortype(_NOCURSOR); ch = getch(); //READ A CHARACTER FROM KEYBOARD if(ch == char(0)) ch = getch(); switch(ch) //MENU SELECTING ROUTING { case char(16) : _setcursortype(_NORMALCURSOR);//ctrl_p PROJECT MENU HOT_KEY active_status_bar(5,1); //PROJECT A_S //menu(5); //SELECT PROJECT MENU menu(list_Cap,list,size,PROJECT); Project_Pull_Menu(); //MAKE PROJECT PULLDOWN MENU MAINMENU(6); //CALL MAIN MENU FUN: break; //MAKE A BREAK FOR switch_STATEMENT case char(6) : _setcursortype(_NORMALCURSOR);//ctrl_f FILE MENU HOT_KEY active_status_bar(1,1); //FILE A_S menu(list_Cap,list,size,FILE_); //menu(1); //SELETE FILE MENU File_Pull_Menu(); //MAKE FILE PULLDOWN MENU MAINMENU(6); //CALL MAIN MENU FUN: break; //MAKE A BREAK FOR switch_STATEMENT case char(8) : _setcursortype(_NORMALCURSOR);//ctrl_h HACKER MENU HOT_KEY active_status_bar(2,1); //HACKER A_S menu(list_Cap,list,size,PROGRAMMER); //menu(2); //SELECT HACKER MENU PROGRAMMER_Pull_Menu(); //MAKE HACKER PULLDOWN MENU MAINMENU(2); //CALL MAIN MENU FUN: break; //MAKE A BREAK FOR switch_STATEMENT case char(19) : Popup_Menu(); break; //ctrl-s CALL SECRET ROUTING! case char(27) : Msgbox(); //to exit (Esc) CREATE MESSAGE BOX TO COMFIRM QUITING //==================================== //IF L_ARROW :IF CURRENT SELETION IS <EXIT>FIRST THEN SELECT <HELP>SIZE // IF NOT THEN SELECT CURRENT (SELETION-1) POSITION case char(75) : index = (index == 1) ? size : index-1;break;//<-- L_ARROW //IF R_ARROW :IF CURRENT SELETION IS <HELP>LAST THEN SELECT <EXIT>FIRST // IF NOT THEN SELECT CURRENT (SELETION+1) POSITION case char(77) : index = (index == size) ? 1 : index+1;break;//--> R_ARROW //IF ENTER :DO FUN: ACCORDING TO THE CURRENT SELECTED <INDEX>FUN: case char(13) : switch(index){ //<--|ENTER //IF EXIT case 1 : _setcursortype(_NORMALCURSOR);//INDEX<1>CHOOSE TO EXIT Msgbox(); //COMFIRM EXIT exit(0); //EXIT THE PROGRAM break; //IF FILE case 2 : _setcursortype(_NORMALCURSOR); active_status_bar(index-2,2); //FILE A_S File_Pull_Menu(); //FILE PULL DOWN MENU CREATED menu(list_Cap,list,size,FILE_); //menu(1); //FILE HIGHLIGHT break; //IF HACKER case 8 : _setcursortype(_NORMALCURSOR); active_status_bar(index-3,3); // PROGRAMMER_Pull_Menu(); //PROGRAMMER PULL DOWN menu(list_Cap,list,size,PROGRAMMER); //menu(2); break; //IF SYSTEM case 4 : _setcursortype(_NORMALCURSOR); Dosshell(); MAINMENU(4); break; //IF PROJECT case 5 : MAINMENU(5); break; //IF SUPERVISOR case 6 : _setcursortype(_NORMALCURSOR); //PROJECT MENU ***LEFT *** active_status_bar(index-6,6); // Project_Pull_Menu(); MAINMENU(6); break; //IF HELP case 7: _setcursortype(_NORMALCURSOR); //Help MENU ***LEFT *** HELP(); MAINMENU(7); break; } //IF SECRECT CODE PRESS(CTRL+S) case char(80) : switch(index){ case 1 : _setcursortype(_NORMALCURSOR); Msgbox(); exit(0); break; case 2 : _setcursortype(_NORMALCURSOR); active_status_bar(index-2,2); //FILE File_Pull_Menu(); //FILE PULL DOWN menu(list_Cap,list,size,FILE_); //menu(1); //FILE HIGHLIGHT break; case 3 : _setcursortype(_NORMALCURSOR); active_status_bar(index-3,3); // PROGRAMMER_Pull_Menu(); //PROGRAMMER PULL DOWN menu(list_Cap,list,size,PROGRAMMER); //menu(2); break; case 4 : _setcursortype(_NORMALCURSOR); Dosshell(); active_status_bar(1,1); // MAINMENU(3); break; case 5 : MAINMENU(5); break; case 6 : _setcursortype(_NORMALCURSOR); //PROJECT MENU ***LEFT *** active_status_bar(index-6,6); // Project_Pull_Menu(); MAINMENU(6); break; case 7: _setcursortype(_NORMALCURSOR); //Help MENU ***LEFT *** HELP(); MAINMENU(7); break; } //inner switch end } // outter switch end active_status_bar(index-1,1); // menu(list_Cap,list,size,index-1); } while ( ch != 13 || ch != 27 || ch != 6 || ch != 3 || ch != 27 ); }