Skip to content

Commit

Permalink
make config file comments more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
Glease committed Jun 20, 2023
1 parent 56d39dd commit ceb409b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/main/java/net/glease/tc4tweak/ConfigurationHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ void init(File f) {
setLanguageKeys();
}

private void breakLongCommentLines() {
for (String categoryName : config.getCategoryNames()) {
ConfigCategory category = config.getCategory(categoryName);
for (Map.Entry<String, Property> entry : category.entrySet()) {
entry.getValue().comment = entry.getValue().comment.replace(". ", ".\n");
}
}
}

private void setLanguageKeys() {
for (String categoryName : config.getCategoryNames()) {
ConfigCategory category = config.getCategory(categoryName);
Expand Down Expand Up @@ -119,6 +128,7 @@ private void loadConfig(boolean send) {
TC4Tweak.INSTANCE.detectAndSendConfigChanges();
BrowserPaging.flushCache();
}
breakLongCommentLines();
config.save();
}

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.9
1.5.10

0 comments on commit ceb409b

Please sign in to comment.