Skip to content

Commit 0a9644a

Browse files
committed
More documentation inside config file
1 parent 7ad09ac commit 0a9644a

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

common/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,17 @@ public void save() throws IOException {
373373

374374
try (Writer writer = new FileWriter(configFile)) {
375375
writer.write("# This is the configuration file for ModernFix.\n");
376+
writer.write("# In general, prefer using the config screen to editing this file. It can be accessed\n");
377+
writer.write("# via the standard mod menu on your respective mod loader. Changes will, however,\n");
378+
writer.write("# require restarting the game to take effect.\n");
376379
writer.write("#\n");
377380
writer.write("# The following options can be enabled or disabled if there is a compatibility issue.\n");
378-
writer.write("# Add a line mixin.example_name=true/false without the # sign to enable/disable a rule.\n");
381+
writer.write("# Add a line with your option name and =true or =false at the bottom of the file to enable\n");
382+
writer.write("# or disable a rule. For example:\n");
383+
writer.write("# mixin.perf.dynamic_resources=true\n");
384+
writer.write("# Do not include the #. You may reset to defaults by deleting this file.\n");
385+
writer.write("#\n");
386+
writer.write("# Available options:\n");
379387
List<String> keys = this.options.keySet().stream()
380388
.filter(key -> !key.equals("mixin.core"))
381389
.sorted()
@@ -385,17 +393,20 @@ public void save() throws IOException {
385393
Option option = this.options.get(line);
386394
String extraContext = "";
387395
if(option != null) {
388-
if(option.isModDefined())
389-
extraContext = " # (overridden for mod compat)";
396+
if(!option.isUserDefined())
397+
extraContext = "=" + option.isEnabled() + " # " + (option.isModDefined() ? "(overridden for mod compat)" : "(default)");
390398
else {
391399
boolean defaultEnabled = DEFAULT_SETTING_OVERRIDES.getOrDefault(line, true);
392-
extraContext = " # (default: " + defaultEnabled + ")";
400+
extraContext = "=" + defaultEnabled + " # (default)";
393401
}
394402
}
395-
writer.write("# " + line + "\n");
403+
writer.write("# " + line + extraContext + "\n");
396404
}
397405
}
398406

407+
writer.write("#\n");
408+
writer.write("# User overrides go here.\n");
409+
399410
for (String key : keys) {
400411
Option option = this.options.get(key);
401412
if(option.isUserDefined())

0 commit comments

Comments
 (0)