Beispiel #1
0
Datei: menu.c Projekt: zid/naev
/**
 * @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();
}
Beispiel #2
0
Datei: menu.c Projekt: naev/naev
/**
 * @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();
}
Beispiel #3
0
Datei: menu.c Projekt: zid/naev
/**
 * @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);
}
Beispiel #4
0
Datei: menu.c Projekt: zid/naev
/**
 * @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);
}
Beispiel #5
0
Datei: menu.c Projekt: naev/naev
/**
 * @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();
}
Beispiel #6
0
/**
 * @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);
   }
}
Beispiel #7
0
Datei: menu.c Projekt: pegue/naev
/**
 * @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();
}
Beispiel #8
0
Datei: menu.c Projekt: zid/naev
/**
 * @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();
}
Beispiel #9
0
Datei: menu.c Projekt: zid/naev
/**
 * @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();
}
Beispiel #10
0
Datei: menu.c Projekt: zid/naev
/**
 * @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();
}
Beispiel #11
0
Datei: menu.c Projekt: naev/naev
/**
 * @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();
}
Beispiel #12
0
Datei: menu.c Projekt: pegue/naev
/**
 * @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);
}
Beispiel #13
0
Datei: menu.c Projekt: naev/naev
/**
 * @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();
}
Beispiel #14
0
Datei: menu.c Projekt: naev/naev
/**
 * @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();
}
Beispiel #15
0
Datei: menu.c Projekt: naev/naev
/**
 * @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;
}
Beispiel #16
0
Datei: menu.c Projekt: naev/naev
/**
 * @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;
}
Beispiel #17
0
Datei: menu.c Projekt: zid/naev
/**
 * @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);
}