Make gamelogs readable (#9210)

* Make gamelogs readable:
They are now .html files as they're supposed to be.
The background is black so the text is readable.
Added line breaks.

* Added comment that CCCC33 is TIMESTAMP_COLOR

* More comment

Co-authored-by: sprangg <a@b.c>
This commit is contained in:
sprangg 2022-07-03 01:03:50 +03:00 committed by GitHub
parent 7bed65e8ec
commit ae189bad22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -104,9 +104,12 @@
.append(sdf.format(gameEndView.getStartTime()))
.append('_').append(gameEndView.getMatchView().getGameType())
.append('_').append(gameEndView.getMatchView().getGames().size())
.append(".txt").toString();
.append(".html").toString();
PrintWriter out = new PrintWriter(fileName);
out.print(gamePanel.getGameLog());
String log = gamePanel.getGameLog();
log = log.replace("<body>", "<body style=\"background-color:black\">");
log = log.replace("<font color=\"#CCCC33\">", "<br><font color=\"#CCCC33\">"); //The color is TIMESTAMP_COLOR and we can utilize it to add line breaks to new lines
out.print(log);
out.close();
}
}