/** * @brief Closes the small ingame menu and goes back to the main menu. * @param str Unused. */ static void menu_small_exit( unsigned int wid, char* str ) { (void) str; unsigned int info_wid; /* if landed we must save anyways */ if (landed) { /* increment time to match takeoff */ ntime_inc( RNG( 2*NTIME_UNIT_LENGTH, 3*NTIME_UNIT_LENGTH ) ); save_all(); land_cleanup(); } /* Close info menu if open. */ if (menu_isOpen(MENU_INFO)) { info_wid = window_get("Info"); window_destroy( info_wid ); menu_Close(MENU_INFO); } /* Stop player sounds because sometimes they hang. */ player_abortAutonav( "Exited game." ); player_stopSound(); /* Clean up. */ window_destroy( wid ); menu_Close(MENU_SMALL); menu_main(); }
/** * @brief Closes the small ingame menu and goes back to the main menu. * @param str Unused. */ static void menu_small_exit( unsigned int wid, char* str ) { (void) str; unsigned int info_wid, board_wid; /* if landed we must save anyways */ if (landed) { save_all(); land_cleanup(); } /* Close info menu if open. */ if (menu_isOpen(MENU_INFO)) { info_wid = window_get("Info"); window_destroy( info_wid ); menu_Close(MENU_INFO); } /* Force unboard. */ if (player_isBoarded()) { board_wid = window_get("Boarding"); board_exit(board_wid, NULL); } /* Stop player sounds because sometimes they hang. */ player_restoreControl( 0, _("Exited game.") ); player_soundStop(); /* Clean up. */ window_destroy( wid ); menu_Close(MENU_SMALL); menu_main(); }
/** * @brief Closes the main menu. */ void menu_main_close (void) { if (window_exists("Main Menu")) window_destroy( window_get("Main Menu") ); menu_Close(MENU_MAIN); }
/** * @brief Closes the options menu. * @param str Unused. */ static void menu_options_close( unsigned int wid, char* str ) { (void) str; window_destroy( wid ); menu_Close(MENU_OPTIONS); }
/** * @brief Function to active the new game menu. * @param str Unused. */ static void menu_main_tutorial( unsigned int wid, char* str ) { (void) str; (void) wid; window_destroy( wid ); menu_Close(MENU_MAIN); pause_game(); player_newTutorial(); }
/** * @brief Closes the information menu. * @param str Unused. */ static void info_close( unsigned int wid, char* str ) { (void) wid; if (info_wid > 0) { window_close( info_wid, str ); info_wid = 0; menu_Close(MENU_INFO); } }
/** * @brief Closes the information menu. * @param str Unused. */ static void menu_info_close( unsigned int wid, char* str ) { (void) str; window_destroy( wid ); menu_Close(MENU_INFO); /* Resume player sounds. */ player_soundResume(); }
/** * @brief Restart the game, when player want to continue after death but without a savegame */ static void menu_death_restart( unsigned int wid, char* str ) { (void) str; window_destroy( wid ); menu_Close(MENU_DEATH); player_new(); }
/** * @brief Reload the current savegame, when player want to continue after death */ static void menu_death_continue( unsigned int wid, char* str ) { (void) str; window_destroy( wid ); menu_Close(MENU_DEATH); reload(); }
/** * @brief Closes the player death menu. * @param str Unused. */ static void menu_death_main( unsigned int wid, char* str ) { (void) str; window_destroy( wid ); menu_Close(MENU_DEATH); /* Game will repause now since toolkit closes and reopens. */ menu_main(); }
/** * @brief Closes the main menu. */ void menu_main_close (void) { if (window_exists("Main Menu")) window_destroy( window_get("Main Menu") ); else WARN( _("Main menu does not exist.") ); menu_Close(MENU_MAIN); pause_game(); }
/** * @brief Closes the options menu. * @param str Unused. */ static void menu_options_close( unsigned int parent, char* str ) { (void) parent; (void) str; unsigned int wid; wid = window_get( "Options" ); window_destroy( wid ); menu_Close(MENU_OPTIONS); }
/** * @brief Restart the game, when player want to continue after death but without a savegame */ static void menu_death_restart( unsigned int wid, char* str ) { (void) str; window_destroy( wid ); menu_Close(MENU_DEATH); if (player_isTut()) player_newTutorial(); else player_new(); }
/** * @brief Function to active the new game menu. * @param str Unused. */ static void menu_main_new( unsigned int wid, char* str ) { (void) str; (void) wid; /* Closes the main menu window. */ window_destroy( wid ); menu_Close(MENU_MAIN); pause_game(); /* Start the new player. */ player_new(); }
/** * @brief Closes the editors menu. * @param str Unused. */ static void menu_editors_close( unsigned int wid, char* str ) { (void)str; /* Close the Editors Menu and mark it as closed */ /*WARN("Entering function.");*/ window_destroy( wid ); menu_Close( MENU_EDITORS ); /* Restores Main Menu */ /*WARN("Restoring Main Menu.");*/ menu_main(); /*WARN("Exiting function.");*/ return; }
/** * @brief Menu to ask if player really wants to quit. */ int menu_askQuit (void) { /* Asked twice, quit. */ if (menu_isOpen( MENU_ASKQUIT )) { exit_game(); return 1; } /* Ask if should quit. */ menu_Open( MENU_ASKQUIT ); if (dialogue_YesNoRaw( _("Quit Naev"), _("Are you sure you want to quit Naev?") )) { exit_game(); return 1; } menu_Close( MENU_ASKQUIT ); return 0; }
/** * @brief Closes the small ingame menu. * @param str Unused. */ static void menu_small_close( unsigned int wid, char* str ) { (void)str; window_destroy( wid ); menu_Close(MENU_SMALL); }