Fixed chat history text line spacing to a smaller amount.

tags: #story[1245]
This commit is contained in:
Haoming Yin
2017-09-12 11:12:35 +12:00
parent 8c2125276e
commit 6d9864e677
@@ -53,7 +53,7 @@ public class ChatHistory extends ScrollPane {
public void addMessage (Paint colour, String Text) { public void addMessage (Paint colour, String Text) {
String[] words = Text.split(":"); String[] words = Text.split(":");
if (words[0].trim().equals("SERVER")) { if (words[0].trim().equals("SERVER")) {
Text text = new Text(Text + "\n\n"); Text text = new Text(Text + "\n");
text.setStyle("-fx-font-weight: bolder"); text.setStyle("-fx-font-weight: bolder");
textFlow.getChildren().add(text); textFlow.getChildren().add(text);
} else { } else {
@@ -63,7 +63,7 @@ public class ChatHistory extends ScrollPane {
timePlayer.setStyle("-fx-font-weight: bold"); timePlayer.setStyle("-fx-font-weight: bold");
timePlayer.setFill(colour); timePlayer.setFill(colour);
Text message = new Text( Text message = new Text(
String.join(":", Arrays.copyOfRange(words, 3, words.length)) + "\n\n" String.join(":", Arrays.copyOfRange(words, 3, words.length)) + "\n"
); );
message.wrappingWidthProperty().bind(this.widthProperty()); message.wrappingWidthProperty().bind(this.widthProperty());
textFlow.getChildren().addAll(timePlayer, message); textFlow.getChildren().addAll(timePlayer, message);