mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Merge remote-tracking branch 'origin/develop' into develop
# Conflicts: # src/main/java/seng302/visualiser/controllers/RaceViewController.java # src/main/resources/images/wind-180.png
This commit is contained in:
@@ -142,6 +142,8 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
|||||||
private Timer blinkingTimer = new Timer();
|
private Timer blinkingTimer = new Timer();
|
||||||
private ImageView iconToDisplay;
|
private ImageView iconToDisplay;
|
||||||
|
|
||||||
|
private Double lastWindDirection;
|
||||||
|
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
contentStackPane.setVisible(false);
|
contentStackPane.setVisible(false);
|
||||||
Image loadingImage = new Image("PP.png");
|
Image loadingImage = new Image("PP.png");
|
||||||
@@ -190,6 +192,8 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
|||||||
chatHistory.decreaseOpacity();
|
chatHistory.decreaseOpacity();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
lastWindDirection = 0d;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showFinishDialog(ArrayList<ClientYacht> finishedBoats) {
|
public void showFinishDialog(ArrayList<ClientYacht> finishedBoats) {
|
||||||
@@ -435,15 +439,14 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
|||||||
* Updates the wind direction arrow and text as from info from the StreamParser
|
* Updates the wind direction arrow and text as from info from the StreamParser
|
||||||
* @param direction the from north angle of the wind.
|
* @param direction the from north angle of the wind.
|
||||||
*/
|
*/
|
||||||
private double preDir = 0;
|
|
||||||
private void updateWindDirection(double direction) {
|
private void updateWindDirection(double direction) {
|
||||||
windDirectionLabel.setText(String.format("%.1f°", direction));
|
windDirectionLabel.setText(String.format("%.1f°", direction));
|
||||||
RotateTransition rt = new RotateTransition(Duration.millis(300), windImageView);
|
RotateTransition rt = new RotateTransition(Duration.millis(300), windImageView);
|
||||||
rt.setByAngle(direction - preDir);
|
rt.setByAngle(direction - lastWindDirection);
|
||||||
rt.setCycleCount(5);
|
rt.setCycleCount(3);
|
||||||
rt.setAutoReverse(true);
|
rt.setAutoReverse(true);
|
||||||
rt.play();
|
rt.play();
|
||||||
preDir = direction;
|
lastWindDirection = direction;
|
||||||
// windImageView.setRotate(direction);
|
// windImageView.setRotate(direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Reference in New Issue
Block a user