Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Zhi You Tan
2017-07-25 17:17:45 +12:00
4 changed files with 10 additions and 1 deletions
@@ -51,6 +51,8 @@ import java.util.stream.Collectors;
*/ */
public class RaceViewController extends Thread implements ImportantAnnotationDelegate { public class RaceViewController extends Thread implements ImportantAnnotationDelegate {
@FXML
private Text windSpeedText;
@FXML @FXML
private LineChart raceSparkLine; private LineChart raceSparkLine;
@FXML @FXML
@@ -335,6 +337,7 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
private void updateWindDirection() { private void updateWindDirection() {
windDirectionText.setText(String.format("%.1f°", ClientPacketParser.getWindDirection())); windDirectionText.setText(String.format("%.1f°", ClientPacketParser.getWindDirection()));
windArrowText.setRotate(ClientPacketParser.getWindDirection()); windArrowText.setRotate(ClientPacketParser.getWindDirection());
windSpeedText.setText(String.format("%.1f Knots", ClientPacketParser.getWindSpeed()));
} }
@@ -25,7 +25,7 @@ public class GameState {
public GameState(String hostIpAddress) { public GameState(String hostIpAddress) {
windDirection = 170d; windDirection = 170d;
windSpeed = 1300d; windSpeed = 10000d;
yachts = new HashMap<>(); yachts = new HashMap<>();
players = new ArrayList<>(); players = new ArrayList<>();
@@ -11,6 +11,7 @@ public class RaceStatusMessage extends Message{
private final int MESSAGE_BASE_SIZE = 24; private final int MESSAGE_BASE_SIZE = 24;
private final double windDirFactor = 0x4000 / 90; private final double windDirFactor = 0x4000 / 90;
private long currentTime; private long currentTime;
private long raceId; private long raceId;
private RaceStatus raceStatus; private RaceStatus raceStatus;
+5
View File
@@ -35,6 +35,11 @@
<Font name="System Bold" size="13.0" /> <Font name="System Bold" size="13.0" />
</font> </font>
</Text> </Text>
<Text fx:id="windSpeedText" fill="#d3d3d3" layoutX="12.0" layoutY="213.0" strokeType="OUTSIDE" strokeWidth="0.0" text="0.0 Knot" textAlignment="RIGHT">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Text>
<CheckBox fx:id="toggleFps" focusTraversable="false" graphicTextGap="0.0" layoutX="21.0" layoutY="453.0" mnemonicParsing="false" prefHeight="18.0" prefWidth="143.0" selected="true" styleClass="ui-checkbox" text="Show FPS" textFill="WHITE" /> <CheckBox fx:id="toggleFps" focusTraversable="false" graphicTextGap="0.0" layoutX="21.0" layoutY="453.0" mnemonicParsing="false" prefHeight="18.0" prefWidth="143.0" selected="true" styleClass="ui-checkbox" text="Show FPS" textFill="WHITE" />
<VBox fx:id="positionVbox" layoutX="12.0" layoutY="280.0" prefHeight="140.0" prefWidth="200.0" styleClass="text-white" /> <VBox fx:id="positionVbox" layoutX="12.0" layoutY="280.0" prefHeight="140.0" prefWidth="200.0" styleClass="text-white" />
<Pane layoutX="11.0" layoutY="30.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="51.0" prefWidth="193.0"> <Pane layoutX="11.0" layoutY="30.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="51.0" prefWidth="193.0">