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 wind_arrow
# Conflicts: # src/main/resources/css/RaceView.css # src/main/resources/views/RaceView.fxml
This commit is contained in:
@@ -69,7 +69,7 @@ public class GameState implements Runnable {
|
|||||||
|
|
||||||
//Collision constants
|
//Collision constants
|
||||||
private static final Double MARK_COLLISION_DISTANCE = 15d;
|
private static final Double MARK_COLLISION_DISTANCE = 15d;
|
||||||
public static final Double YACHT_COLLISION_DISTANCE = 25.0;
|
public static final Double YACHT_COLLISION_DISTANCE = 15.0;
|
||||||
private static final Double BOUNCE_DISTANCE_MARK = 20.0;
|
private static final Double BOUNCE_DISTANCE_MARK = 20.0;
|
||||||
public static final Double BOUNCE_DISTANCE_YACHT = 30.0;
|
public static final Double BOUNCE_DISTANCE_YACHT = 30.0;
|
||||||
private static final Double COLLISION_VELOCITY_PENALTY = 0.3;
|
private static final Double COLLISION_VELOCITY_PENALTY = 0.3;
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ public class RaceViewController extends Thread {
|
|||||||
@FXML
|
@FXML
|
||||||
private Pane chatHistoryHolder;
|
private Pane chatHistoryHolder;
|
||||||
@FXML
|
@FXML
|
||||||
|
private JFXButton chatToggleButton;
|
||||||
|
@FXML
|
||||||
private TextField chatInput;
|
private TextField chatInput;
|
||||||
@FXML
|
@FXML
|
||||||
private Label timerLabel;
|
private Label timerLabel;
|
||||||
@@ -112,6 +114,8 @@ public class RaceViewController extends Thread {
|
|||||||
public void initialize() {
|
public void initialize() {
|
||||||
miniMapPane.setVisible(false);
|
miniMapPane.setVisible(false);
|
||||||
miniMapButton.setVisible(false);
|
miniMapButton.setVisible(false);
|
||||||
|
chatHistoryHolder.setVisible(false);
|
||||||
|
chatToggleButton.setVisible(false);
|
||||||
contentStackPane.setVisible(false);
|
contentStackPane.setVisible(false);
|
||||||
Image loadingImage = new Image("PP.png");
|
Image loadingImage = new Image("PP.png");
|
||||||
loadingScreen.setImage(loadingImage);
|
loadingScreen.setImage(loadingImage);
|
||||||
@@ -147,6 +151,9 @@ public class RaceViewController extends Thread {
|
|||||||
chatHistoryHolder.heightProperty()
|
chatHistoryHolder.heightProperty()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
contentStackPane.getChildren().remove(chatToggleButton);
|
||||||
|
contentStackPane.getChildren().add(chatToggleButton);
|
||||||
|
|
||||||
contentStackPane.setOnMouseClicked(event -> {
|
contentStackPane.setOnMouseClicked(event -> {
|
||||||
contentStackPane.requestFocus();
|
contentStackPane.requestFocus();
|
||||||
});
|
});
|
||||||
@@ -197,6 +204,9 @@ public class RaceViewController extends Thread {
|
|||||||
contentStackPane.setVisible(true);
|
contentStackPane.setVisible(true);
|
||||||
miniMapPane.setVisible(true);
|
miniMapPane.setVisible(true);
|
||||||
miniMapButton.setVisible(true);
|
miniMapButton.setVisible(true);
|
||||||
|
chatHistoryHolder.setVisible(true);
|
||||||
|
chatToggleButton.setVisible(true);
|
||||||
|
|
||||||
Platform.runLater(() -> contentStackPane.requestFocus());
|
Platform.runLater(() -> contentStackPane.requestFocus());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,6 +258,16 @@ public class RaceViewController extends Thread {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
chatToggleButton.setOnMouseClicked((event) -> {
|
||||||
|
if (chatHistoryHolder.visibleProperty().get()) {
|
||||||
|
chatHistoryHolder.setVisible(false);
|
||||||
|
chatToggleButton.setText("+");
|
||||||
|
} else {
|
||||||
|
chatHistoryHolder.setVisible(true);
|
||||||
|
chatToggleButton.setText("—");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
contentStackPane.getChildren().add(0, gameView.getAssets());
|
contentStackPane.getChildren().add(0, gameView.getAssets());
|
||||||
((SubScene) gameView.getAssets()).widthProperty()
|
((SubScene) gameView.getAssets()).widthProperty()
|
||||||
|
|||||||
@@ -6,10 +6,16 @@ import com.jfoenix.controls.JFXDialog;
|
|||||||
import com.jfoenix.controls.JFXDialog.DialogTransition;
|
import com.jfoenix.controls.JFXDialog.DialogTransition;
|
||||||
import com.jfoenix.controls.JFXSnackbar;
|
import com.jfoenix.controls.JFXSnackbar;
|
||||||
import com.jfoenix.svg.SVGGlyph;
|
import com.jfoenix.svg.SVGGlyph;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.scene.*;
|
import javafx.scene.Cursor;
|
||||||
|
import javafx.scene.Node;
|
||||||
|
import javafx.scene.Parent;
|
||||||
|
import javafx.scene.Scene;
|
||||||
|
import javafx.scene.SceneAntialiasing;
|
||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
import javafx.scene.layout.HBox;
|
import javafx.scene.layout.HBox;
|
||||||
import javafx.scene.layout.StackPane;
|
import javafx.scene.layout.StackPane;
|
||||||
@@ -24,9 +30,6 @@ import seng302.visualiser.GameClient;
|
|||||||
import seng302.visualiser.controllers.dialogs.KeyBindingDialogController;
|
import seng302.visualiser.controllers.dialogs.KeyBindingDialogController;
|
||||||
import seng302.visualiser.controllers.dialogs.PopupDialogController;
|
import seng302.visualiser.controllers.dialogs.PopupDialogController;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
public class ViewManager {
|
public class ViewManager {
|
||||||
|
|
||||||
private static ViewManager instance;
|
private static ViewManager instance;
|
||||||
@@ -376,8 +379,8 @@ public class ViewManager {
|
|||||||
scene.setOnKeyPressed(gameClient::keyPressed);
|
scene.setOnKeyPressed(gameClient::keyPressed);
|
||||||
scene.setOnKeyReleased(gameClient::keyReleased);
|
scene.setOnKeyReleased(gameClient::keyReleased);
|
||||||
|
|
||||||
stage.setMinHeight(500);
|
stage.setMinHeight(800);
|
||||||
stage.setMinWidth(800);
|
stage.setMinWidth(1200);
|
||||||
stage.setTitle("Party Parrots At Sea");
|
stage.setTitle("Party Parrots At Sea");
|
||||||
stage.getIcons().add(new Image(getClass().getResourceAsStream("/PP.png")));
|
stage.getIcons().add(new Image(getClass().getResourceAsStream("/PP.png")));
|
||||||
stage.setOnCloseRequest(e -> closeAll());
|
stage.setOnCloseRequest(e -> closeAll());
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#timerGrid{
|
#timerGrid{
|
||||||
-fx-background-color: rgba(255, 255, 255, 0.6);
|
-fx-background-color: rgba(255, 255, 255, 0.6);
|
||||||
-fx-effect: -fx-pp-dropshadow-light;
|
-fx-effect: -fx-pp-dropshadow-light;
|
||||||
|
-fx-background-radius: 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
GridPane .timer * {
|
GridPane .timer * {
|
||||||
@@ -27,20 +28,24 @@ GridPane .timer * {
|
|||||||
#chatHistoryHolder {
|
#chatHistoryHolder {
|
||||||
-fx-background-color: rgba(255, 255, 255, 0.6);
|
-fx-background-color: rgba(255, 255, 255, 0.6);
|
||||||
-fx-effect: -fx-pp-dropshadow-light;
|
-fx-effect: -fx-pp-dropshadow-light;
|
||||||
|
-fx-background-radius: 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
#chatInputHolder {
|
#chatInputHolder {
|
||||||
-fx-background-color: rgba(255, 255, 255, 0.6);
|
-fx-background-color: rgba(255, 255, 255, 0.6);
|
||||||
-fx-effect: -fx-pp-dropshadow-light;
|
-fx-effect: -fx-pp-dropshadow-light;
|
||||||
|
-fx-background-radius: 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
#windGridPane {
|
#windGridPane {
|
||||||
-fx-background-color: rgba(255, 255, 255, 0.6);
|
-fx-background-color: rgba(255, 255, 255, 0.6);
|
||||||
-fx-effect: -fx-pp-dropshadow-light;
|
-fx-effect: -fx-pp-dropshadow-light;
|
||||||
|
-fx-background-radius: 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
#windHolder {
|
#windHolder {
|
||||||
-fx-background-color: rgba(255, 255, 255, 0.5);
|
-fx-background-color: rgba(255, 255, 255, 0.5);
|
||||||
|
-fx-background-radius: 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
#chatSend {
|
#chatSend {
|
||||||
@@ -61,6 +66,18 @@ GridPane .timer * {
|
|||||||
-fx-background-color: transparent;
|
-fx-background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*#windImageView {*/
|
#windImageView {
|
||||||
/*-fx-image: url("/images/wind-180.png");*/
|
-fx-image: url("/images/wind-180.png");
|
||||||
/*}*/
|
}
|
||||||
|
|
||||||
|
#miniMapPane {
|
||||||
|
-fx-background-color: rgba(255, 255, 255, 0.6);
|
||||||
|
-fx-background-radius: 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
#miniMapButton {
|
||||||
|
-fx-background-color: rgba(255, 255, 255, 0.6);
|
||||||
|
-fx-background-radius: 5;
|
||||||
|
-fx-min-width: 30;
|
||||||
|
-fx-min-height: 30;
|
||||||
|
}
|
||||||
@@ -2,18 +2,21 @@
|
|||||||
|
|
||||||
<?import com.jfoenix.controls.*?>
|
<?import com.jfoenix.controls.*?>
|
||||||
<?import java.lang.*?>
|
<?import java.lang.*?>
|
||||||
|
<?import java.net.*?>
|
||||||
<?import javafx.geometry.*?>
|
<?import javafx.geometry.*?>
|
||||||
<?import javafx.scene.control.*?>
|
<?import javafx.scene.control.*?>
|
||||||
<?import javafx.scene.image.*?>
|
<?import javafx.scene.image.*?>
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
<?import javafx.scene.text.*?>
|
<?import javafx.scene.text.*?>
|
||||||
<?import com.jfoenix.controls.JFXButton?>
|
<?import com.jfoenix.controls.JFXButton?>
|
||||||
|
<?import com.jfoenix.controls.JFXSpinner?>
|
||||||
<?import com.jfoenix.controls.JFXTextField?>
|
<?import com.jfoenix.controls.JFXTextField?>
|
||||||
<?import java.lang.String?>
|
<?import java.net.URL?>
|
||||||
<?import javafx.geometry.Insets?>
|
<?import javafx.geometry.Insets?>
|
||||||
<?import javafx.scene.control.Label?>
|
<?import javafx.scene.control.Label?>
|
||||||
<?import javafx.scene.image.Image?>
|
<?import javafx.scene.image.Image?>
|
||||||
<?import javafx.scene.image.ImageView?>
|
<?import javafx.scene.image.ImageView?>
|
||||||
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
<?import javafx.scene.layout.ColumnConstraints?>
|
<?import javafx.scene.layout.ColumnConstraints?>
|
||||||
<?import javafx.scene.layout.GridPane?>
|
<?import javafx.scene.layout.GridPane?>
|
||||||
<?import javafx.scene.layout.Pane?>
|
<?import javafx.scene.layout.Pane?>
|
||||||
@@ -295,7 +298,7 @@
|
|||||||
<Insets right="15.0" top="15.0" />
|
<Insets right="15.0" top="15.0" />
|
||||||
</StackPane.margin>
|
</StackPane.margin>
|
||||||
</Pane>
|
</Pane>
|
||||||
<JFXButton fx:id="miniMapButton" style="-fx-background-color: white; -fx-opacity: 0.45; -fx-background-radius: 10;" text="—" StackPane.alignment="TOP_RIGHT">
|
<JFXButton fx:id="miniMapButton" text="—" StackPane.alignment="TOP_RIGHT">
|
||||||
<font>
|
<font>
|
||||||
<Font size="15.0" />
|
<Font size="15.0" />
|
||||||
</font>
|
</font>
|
||||||
@@ -307,9 +310,17 @@
|
|||||||
<ImageView fx:id="loadingScreen" fitHeight="672.0" fitWidth="1200.0" pickOnBounds="true" preserveRatio="true" />
|
<ImageView fx:id="loadingScreen" fitHeight="672.0" fitWidth="1200.0" pickOnBounds="true" preserveRatio="true" />
|
||||||
<JFXSpinner layoutX="566.0" layoutY="692.0" radius="30.0" />
|
<JFXSpinner layoutX="566.0" layoutY="692.0" radius="30.0" />
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
|
<JFXButton fx:id="chatToggleButton" text="—" StackPane.alignment="BOTTOM_RIGHT">
|
||||||
|
<font>
|
||||||
|
<Font size="15.0"/>
|
||||||
|
</font>
|
||||||
|
<StackPane.margin>
|
||||||
|
<Insets bottom="70.0" right="10.0"/>
|
||||||
|
</StackPane.margin>
|
||||||
|
</JFXButton>
|
||||||
</children>
|
</children>
|
||||||
<stylesheets>
|
<stylesheets>
|
||||||
<String fx:value="/css/Master.css" />
|
<URL value="@../css/Master.css"/>
|
||||||
<String fx:value="/css/RaceView.css" />
|
<URL value="@../css/RaceView.css"/>
|
||||||
</stylesheets>
|
</stylesheets>
|
||||||
</StackPane>
|
</StackPane>
|
||||||
|
|||||||
Reference in New Issue
Block a user