1
0
mirror of https://github.com/fazo96/AIrium.git synced 2025-01-10 09:34:20 +01:00
This commit is contained in:
Enrico Fasoli 2015-08-07 11:49:35 +02:00
parent 2e5a4ca26e
commit dc6a4a2a01

View File

@ -1082,7 +1082,7 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
JOptionPane.showMessageDialog(this, "Please select a creature first"); JOptionPane.showMessageDialog(this, "Please select a creature first");
return; return;
} }
File f = saveDialog(game.getWorld().getSelectedCreature().getBrain().getName()+".brain"); File f = saveDialog(game.getWorld().getSelectedCreature().getBrain().getName() + ".brain");
if (f == null) { if (f == null) {
return; return;
} }
@ -1116,7 +1116,7 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
} }
String settings = Serializer.serializeSettings(options); String settings = Serializer.serializeSettings(options);
Serializer.saveToFile(f, settings); Serializer.saveToFile(f, settings);
JOptionPane.showMessageDialog(this, "Done"); //JOptionPane.showMessageDialog(this, "Done");
}//GEN-LAST:event_saveSettingsBtnActionPerformed }//GEN-LAST:event_saveSettingsBtnActionPerformed
private void loadSettingsBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loadSettingsBtnActionPerformed private void loadSettingsBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loadSettingsBtnActionPerformed
@ -1129,11 +1129,11 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
return; return;
} }
options.putAll(Serializer.readSettings(Serializer.loadFromFile(f))); options.putAll(Serializer.readSettings(Serializer.loadFromFile(f)));
/*if (game != null) {
game.getWorld().replaceOptions(options);
}*/
updateSettingsUI(); updateSettingsUI();
JOptionPane.showMessageDialog(this, "Done"); if (game != null && game.getWorld() != null) {
game.getWorld().reloadOptions();
}
//JOptionPane.showMessageDialog(this, "Done");
}//GEN-LAST:event_loadSettingsBtnActionPerformed }//GEN-LAST:event_loadSettingsBtnActionPerformed
/** /**
* Reads settings and adjusts UI sliders. * Reads settings and adjusts UI sliders.