Made the 'patching complete' dialog stay open, when the game cannot or should not be run

This commit is contained in:
Vhati 2013-09-07 01:29:39 -04:00
parent 30a2b05483
commit 22bf3b0e76

View file

@ -773,7 +773,14 @@ public class ManagerFrame extends JFrame implements ActionListener, HashObserver
resDat.bakFile = new File( backupDir, "resource.dat.bak" ); resDat.bakFile = new File( backupDir, "resource.dat.bak" );
ModPatchDialog patchDlg = new ModPatchDialog( this, true ); ModPatchDialog patchDlg = new ModPatchDialog( this, true );
patchDlg.setSuccessTask( new SpawnGameTask() );
String neverRunFtl = appConfig.getProperty( "never_run_ftl", "false" );
if ( !neverRunFtl.equals("true") ) {
File exeFile = FTLUtilities.findGameExe( datsDir );
if ( exeFile != null ) {
patchDlg.setSuccessTask( new SpawnGameTask( exeFile ) );
}
}
log.info( "" ); log.info( "" );
log.info( "Patching..." ); log.info( "Patching..." );
@ -917,13 +924,14 @@ public class ManagerFrame extends JFrame implements ActionListener, HashObserver
private class SpawnGameTask implements Runnable { private class SpawnGameTask implements Runnable {
private final File exeFile;
public SpawnGameTask( File exeFile ) {
this.exeFile = exeFile;
}
@Override @Override
public void run() { public void run() {
String neverRunFtl = appConfig.getProperty( "never_run_ftl", "false" );
if ( !neverRunFtl.equals("true") ) {
File datsDir = new File( appConfig.getProperty( "ftl_dats_path" ) );
File exeFile = FTLUtilities.findGameExe( datsDir );
if ( exeFile != null ) { if ( exeFile != null ) {
int response = JOptionPane.showConfirmDialog( ManagerFrame.this, "Do you want to run the game now?", "Ready to Play", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE ); int response = JOptionPane.showConfirmDialog( ManagerFrame.this, "Do you want to run the game now?", "Ready to Play", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE );
if ( response == JOptionPane.YES_OPTION ) { if ( response == JOptionPane.YES_OPTION ) {
@ -938,7 +946,6 @@ public class ManagerFrame extends JFrame implements ActionListener, HashObserver
} }
} }
} }
}
@Override @Override