Skip to content

Commit

Permalink
Save/load config in UTF-8, widen config screen
Browse files Browse the repository at this point in the history
  • Loading branch information
mmyers committed Sep 9, 2023
1 parent 05747b3 commit b32a86d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions EU3_Scenario_Editor/src/editor/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static void main(String[] args) {

File configFile = new File("config.txt");
GenericObject config =
EUGFileIO.load(configFile, ParserSettings.getDefaults().setPrintTimingInfo(false));
EUGFileIO.loadUTF8(configFile, ParserSettings.getDefaults().setPrintTimingInfo(false));
if (config == null)
config = new GenericObject(); // don't crash if no config.txt present

Expand Down Expand Up @@ -107,7 +107,7 @@ private void showDialog() {
JPanel gameDirPanel = new JPanel();
gameDirPanel.setBorder(BorderFactory.createTitledBorder("Game folder (NOT mod folder)"));
final JTextField gameDirField = new JTextField();
gameDirField.setPreferredSize(new Dimension(400, 24));
gameDirField.setPreferredSize(new Dimension(500, 24));
JButton browseButton = new JButton("Browse...");
browseButton.addActionListener(new ActionListener() {
@Override
Expand Down Expand Up @@ -168,7 +168,7 @@ public void changedUpdate(DocumentEvent de) {
JPanel saveGamePanel = new JPanel();
saveGamePanel.setBorder(BorderFactory.createTitledBorder("Saved Game"));
final JTextField saveGameField = new JTextField();
saveGameField.setPreferredSize(new Dimension(400, 24));
saveGameField.setPreferredSize(new Dimension(500, 24));
JButton browseSaveButton = new JButton("Browse...");
browseSaveButton.addActionListener(new ActionListener() {
@Override
Expand Down Expand Up @@ -302,8 +302,8 @@ public void actionPerformed(ActionEvent e) {
Mod mod = (Mod) modBox.getSelectedItem();
game.setString(LAST_MOD_KEY, mod.getName().equals("None") ? "" : mod.getName(), true);

EUGFileIO.save(config, "config.txt", null, true, Style.AGCEEP);

EUGFileIO.saveUTF8(config, "config.txt", true, Style.AGCEEP, ParserSettings.getQuietSettings());
dialog.dispose();

log.log(Level.INFO, "Loading {0}. Mod: {1}", new Object[]{version.getDisplay(), mod.getName()});
Expand Down

0 comments on commit b32a86d

Please sign in to comment.