File tree 2 files changed +9
-7
lines changed
src/main/java/lol/hyper/customlauncher
2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public class ConfigHandler {
33
33
private final Logger logger = LogManager .getLogger (this );
34
34
35
35
public ConfigHandler () {
36
- loadConfig ();
36
+ loadConfig (true );
37
37
}
38
38
39
39
public boolean showCogInvasionNotifications () {
@@ -75,7 +75,7 @@ private void setDefaults() {
75
75
}
76
76
77
77
/** Load the config from disk into the JSON object. */
78
- public void loadConfig () {
78
+ public void loadConfig (boolean log ) {
79
79
if (!CONFIG_FILE .exists ()) {
80
80
jsonObject = new JSONObject ();
81
81
} else {
@@ -95,9 +95,11 @@ public void loadConfig() {
95
95
setDefaults ();
96
96
INSTALL_LOCATION = new File (jsonObject .getString ("ttrInstallLocation" ));
97
97
98
- logger .info ("Config version: " + jsonObject .getInt ("version" ));
99
- logger .info ("showInvasionNotifications: " + showCogInvasionNotifications ());
100
- logger .info ("showFieldOfficeNotifications: " + showFieldOfficeNotifications ());
101
- logger .info ("ttrInstallLocation: " + INSTALL_LOCATION .getAbsolutePath ());
98
+ if (log ) {
99
+ logger .info ("Config version: " + jsonObject .getInt ("version" ));
100
+ logger .info ("showInvasionNotifications: " + showCogInvasionNotifications ());
101
+ logger .info ("showFieldOfficeNotifications: " + showFieldOfficeNotifications ());
102
+ logger .info ("ttrInstallLocation: " + INSTALL_LOCATION .getAbsolutePath ());
103
+ }
102
104
}
103
105
}
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ public class ConfigWindow extends JFrame {
30
30
private final Logger logger = LogManager .getLogger (this );
31
31
32
32
public ConfigWindow (ConfigHandler configHandler ) {
33
- configHandler .loadConfig ();
33
+ configHandler .loadConfig (false );
34
34
JFrame frame = new JFrame ("Configuration" );
35
35
frame .setSize (370 , 270 );
36
36
frame .setDefaultCloseOperation (WindowConstants .DISPOSE_ON_CLOSE );
You can’t perform that action at this time.
0 commit comments