mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
made chat history always scroll to the bottom after a message is sent #story[1246]
This commit is contained in:
@@ -11,6 +11,8 @@ import javafx.animation.Timeline;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.ReadOnlyBooleanProperty;
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ListChangeListener;
|
||||
import javafx.collections.ObservableList;
|
||||
@@ -123,6 +125,9 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
||||
chatInput.setText(chatInput.getText().substring(0, CHAT_LIMIT));
|
||||
}
|
||||
});
|
||||
chatHistory.textProperty().addListener((obs, oldValue, newValue) -> {
|
||||
chatHistory.setScrollTop(Double.MAX_VALUE);
|
||||
});
|
||||
}
|
||||
|
||||
public void loadRace (
|
||||
@@ -657,7 +662,7 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
||||
}
|
||||
|
||||
public void updateChatHistory(Paint playerColour, String newMessage) {
|
||||
chatHistory.setText(chatHistory.getText() + newMessage + '\n');
|
||||
chatHistory.appendText(newMessage + '\n');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user