Added a config option to launch FTL via Steam, if possible (kartoFlane)

This commit is contained in:
Vhati 2015-03-23 03:58:16 -04:00
parent a3ab324308
commit be8a84cd2e
8 changed files with 138 additions and 17 deletions

View file

@ -66,6 +66,7 @@ public class FTLModManager {
Properties config = new Properties();
config.setProperty( "allow_zip", "false" );
config.setProperty( "ftl_dats_path", "" );
config.setProperty( "run_steam_ftl", "false" );
config.setProperty( "never_run_ftl", "false" );
config.setProperty( "use_default_ui", "false" );
config.setProperty( "remember_geometry", "true" );
@ -84,7 +85,7 @@ public class FTLModManager {
writeConfig = true; // Create a new cfg, but only if necessary.
}
}
catch (IOException e) {
catch ( IOException e ) {
log.error( "Error loading config.", e );
showErrorDialog( "Error loading config from "+ configFile.getPath() );
}
@ -101,7 +102,7 @@ public class FTLModManager {
log.trace( "Using system Look and Feel" );
UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
}
catch (Exception e) {
catch ( Exception e ) {
log.error( "Error setting system Look and Feel.", e );
log.info( "Setting 'useDefaultUI=true' in the config file will prevent this error." );
}
@ -195,14 +196,14 @@ public class FTLModManager {
ManagerFrame frame = new ManagerFrame( appConfig, APP_NAME, APP_VERSION, APP_URL, APP_AUTHOR );
frame.init();
frame.setVisible(true);
} catch ( Exception e ) {
}
catch ( Exception e ) {
log.error( "Exception while creating ManagerFrame.", e );
System.exit(1);
}
}
private static void showErrorDialog( String message ) {
JOptionPane.showMessageDialog( null, message, "Error", JOptionPane.ERROR_MESSAGE );
}