fixed issue with the chat history updating weirdly (made sure it run synchronously with platform.runlater) #story[1246]

This commit is contained in:
Peter Galloway
2017-08-31 16:49:12 +12:00
parent 24d4c1df15
commit ba8e333d81
@@ -9,10 +9,7 @@ import java.util.TimerTask;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import javafx.animation.Timeline; import javafx.animation.Timeline;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ReadOnlyBooleanProperty; import javafx.beans.property.ReadOnlyBooleanProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.collections.ListChangeListener; import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
@@ -662,7 +659,7 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
} }
public void updateChatHistory(Paint playerColour, String newMessage) { public void updateChatHistory(Paint playerColour, String newMessage) {
chatHistory.appendText(newMessage + '\n'); Platform.runLater(() -> chatHistory.appendText(newMessage + '\n'));
} }
} }