예제 #1
0
파일: options.c 프로젝트: isfos/naev
/**
 * @brief Updates the gameplay options.
 */
static void opt_gameplayUpdate( unsigned int wid, char *str )
{
    (void) str;
    char buf[16];

    /* Checkboxes. */
    window_checkboxSet( wid, "chkAfterburn", conf.afterburn_sens );
    window_checkboxSet( wid, "chkCompress", conf.save_compress );

    /* Input boxes. */
    snprintf( buf, sizeof(buf), "%d", conf.mesg_visible );
    window_setInput( wid, "inpMSG", buf );
}
예제 #2
0
파일: options.c 프로젝트: s0be/naev
/**
 * @brief Updates the audio widgets.
 */
static void opt_audioUpdate( unsigned int wid, char *str )
{
   (void) str;

   /* Faders. */
   window_faderValue( wid, "fadSound", sound_getVolume() );
   window_faderValue( wid, "fadMusic", music_getVolume() );

   /* Checkboxkes. */
   window_checkboxSet( wid, "chkNosound", conf.nosound );
   window_checkboxSet( wid, "chkEFX", conf.al_efx );

   /* List. */
   toolkit_setList( wid, "lstSound",
         (conf.sound_backend==NULL) ? "none" : conf.sound_backend );
}
예제 #3
0
파일: info.c 프로젝트: nenau/naev
/**
 * @brief Loads a GUI.
 *
 *    @param wdw Window triggering function.
 *    @param str Unused.
 */
static void setgui_load( unsigned int wdw, char *str )
{
   (void)str;
   char *gui;
   int wid;

   wid = window_get( _("Select GUI") );
   gui = toolkit_getList( wid, "lstGUI" );
   if (strcmp(gui,_("None")) == 0)
      return;

   if (player.guiOverride == 0) {
      if (dialogue_YesNo( _("GUI Override is not set."),
               _("Enable GUI Override and change GUI to '%s'?"), gui )) {
         player.guiOverride = 1;
         window_checkboxSet( wid, "chkOverride", player.guiOverride );
      }
      else {
         return;
      }
   }

   /* Set the GUI. */
   if (player.gui != NULL)
      free( player.gui );
   player.gui = strdup( gui );

   /* Close menus before loading for proper rendering. */
   setgui_close(wdw, NULL);

   /* Load the GUI. */
   gui_load( gui_pick() );
}
예제 #4
0
파일: options.c 프로젝트: s0be/naev
/**
 * @brief Updates the gameplay options.
 */
static void opt_gameplayUpdate( unsigned int wid, char *str )
{
   (void) str;
   char vmsg[16], tmax[16];

   /* Checkboxes. */
   window_checkboxSet( wid, "chkZoomManual", conf.zoom_manual );
   window_checkboxSet( wid, "chkAfterburn", conf.afterburn_sens );
   window_checkboxSet( wid, "chkMouseThrust", conf.mouse_thrust );
   window_checkboxSet( wid, "chkCompress", conf.save_compress );

   /* Input boxes. */
   snprintf( vmsg, sizeof(vmsg), "%d", conf.mesg_visible );
   window_setInput( wid, "inpMSG", vmsg );
   snprintf( tmax, sizeof(tmax), "%g", conf.compression_mult );
   window_setInput( wid, "inpTMax", tmax );
}
예제 #5
0
파일: info.c 프로젝트: Jazzkovsky/naev
/**
 * @brief Updates the weapon sets.
 */
static void weapons_update( unsigned int wid, char *str )
{
   (void) str;
   int pos;

   /* Update the position. */
   pos = toolkit_getListPos( wid, "lstWeapSets" );
   info_eq_weaps.weapons = pos;

   /* Update fire mode. */
   window_checkboxSet( wid, "chkFire",
         (pilot_weapSetTypeCheck( player.p, pos ) == WEAPSET_TYPE_WEAPON) );

   /* Update inrange. */
   window_checkboxSet( wid, "chkInrange",
         pilot_weapSetInrangeCheck( player.p, pos ) );

   /* Update autoweap. */
   window_checkboxSet( wid, "chkAutoweap", player.p->autoweap );
}
예제 #6
0
파일: options.c 프로젝트: s0be/naev
static void opt_videoUpdate( unsigned int wid, char *str )
{
   (void) str;
   char buf[16];

   /* Inputs. */
   snprintf( buf, sizeof(buf), "%dx%d", conf.width, conf.height );
   window_setInput( wid, "inpRes", buf );
   snprintf( buf, sizeof(buf), "%d", conf.fps_max );
   window_setInput( wid, "inpFPS", buf );

   /* Checkboxkes. */
   window_checkboxSet( wid, "chkFullscreen", conf.fullscreen );
   window_checkboxSet( wid, "chkVSync", conf.vsync );
   window_checkboxSet( wid, "chkVBO", conf.vbo );
   window_checkboxSet( wid, "chkMipmaps", conf.mipmaps );
   window_checkboxSet( wid, "chkInterpolate", conf.interpolate );
   window_checkboxSet( wid, "chkNPOT", conf.npot );
   window_checkboxSet( wid, "chkFPS", conf.fps_show );
   window_checkboxSet( wid, "chkEngineGlow", conf.engineglow );

   /* Just in case - lazy. */
   opt_needRestart();
}
예제 #7
0
파일: info.c 프로젝트: Jazzkovsky/naev
/**
 * @brief Toggles autoweap for the ship.
 */
static void weapons_autoweap( unsigned int wid, char *str )
{
   int state, sure;

   /* Set state. */
   state = window_checkboxState( wid, str );

   /* Run autoweapons if needed. */
   if (state) {
      sure = dialogue_YesNoRaw( "Enable autoweapons?",
            "Are you sure you want to enable automatic weapon groups for the "
            "ship?\n\nThis will overwrite all manually-tweaked weapons groups." );
      if (!sure) {
         window_checkboxSet( wid, str, 0 );
         return;
      }
      player.p->autoweap = 1;
      pilot_weaponAuto( player.p );
      weapons_genList( wid );
   }
   else
      player.p->autoweap = 0;
}
예제 #8
0
파일: info.c 프로젝트: AvanWolf/naev
/**
 * @brief Sets the fire mode.
 */
static void weapons_fire( unsigned int wid, char *str )
{
   int i, state;

   /* Set state. */
   state = window_checkboxState( wid, str );
   pilot_weapSetMode( player.p, info_eq_weaps.weapons, state );

   /* Check to see if they are all fire groups. */
   for (i=0; i<PILOT_WEAPON_SETS; i++)
      if (!pilot_weapSetModeCheck( player.p, i ))
         break;

   /* Not able to set them all to fire groups. */
   if (i >= PILOT_WEAPON_SETS) {
      dialogue_alert( "You can not set all your weapon sets to fire groups!" );
      pilot_weapSetMode( player.p, info_eq_weaps.weapons, 0 );
      window_checkboxSet( wid, str, 0 );
   }

   /* Set default if needs updating. */
   pilot_weaponSetDefault( player.p );
}
예제 #9
0
파일: info.c 프로젝트: Jazzkovsky/naev
/**
 * @brief Sets the fire mode.
 */
static void weapons_fire( unsigned int wid, char *str )
{
   int i, state, t, c;

   /* Set state. */
   state = window_checkboxState( wid, str );

   /* See how to handle. */
   t = pilot_weapSetTypeCheck( player.p, info_eq_weaps.weapons );
   if (t == WEAPSET_TYPE_ACTIVE)
      return;

   if (state)
      c = WEAPSET_TYPE_WEAPON;
   else
      c = WEAPSET_TYPE_CHANGE;
   pilot_weapSetType( player.p, info_eq_weaps.weapons, c );

   /* Check to see if they are all fire groups. */
   for (i=0; i<PILOT_WEAPON_SETS; i++)
      if (!pilot_weapSetTypeCheck( player.p, i ))
         break;

   /* Not able to set them all to fire groups. */
   if (i >= PILOT_WEAPON_SETS) {
      dialogue_alert( "You can not set all your weapon sets to fire groups!" );
      pilot_weapSetType( player.p, info_eq_weaps.weapons, WEAPSET_TYPE_CHANGE );
      window_checkboxSet( wid, str, 0 );
   }

   /* Set default if needs updating. */
   pilot_weaponSetDefault( player.p );

   /* Must regen. */
   weapons_genList( wid );
}
예제 #10
0
/*
 * @brief Updates autosave check box.
 */
void uniedit_updateAutosave (void)
{
   window_checkboxSet( uniedit_wid, "chkEditAutoSave", conf.devautosave );
}