mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Merge develop into NewUI, and 3D
tags: #story[1245]
This commit is contained in:
@@ -15,16 +15,10 @@ import javafx.scene.chart.NumberAxis;
|
||||
import javafx.scene.chart.XYChart;
|
||||
import javafx.scene.chart.XYChart.Data;
|
||||
import javafx.scene.chart.XYChart.Series;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.CheckBox;
|
||||
import javafx.scene.control.ComboBox;
|
||||
import javafx.scene.control.Slider;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.scene.layout.StackPane;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.paint.Paint;
|
||||
import javafx.scene.shape.Line;
|
||||
import javafx.scene.shape.Polyline;
|
||||
import javafx.scene.text.Text;
|
||||
@@ -36,13 +30,10 @@ import seng302.model.mark.CompoundMark;
|
||||
import seng302.model.mark.Mark;
|
||||
import seng302.model.stream.xml.parser.RaceXMLData;
|
||||
import seng302.utilities.Sounds;
|
||||
import seng302.visualiser.GameView;
|
||||
import seng302.visualiser.controllers.annotations.Annotation;
|
||||
import seng302.visualiser.GameView3D;
|
||||
import seng302.visualiser.controllers.annotations.ImportantAnnotationController;
|
||||
import seng302.visualiser.controllers.annotations.ImportantAnnotationDelegate;
|
||||
import seng302.visualiser.controllers.annotations.ImportantAnnotationsState;
|
||||
import seng302.visualiser.fxObjects.BoatObject;
|
||||
import seng302.visualiser.fxObjects.ChatHistory;
|
||||
import seng302.visualiser.fxObjects.assets_2D.BoatObject;
|
||||
import seng302.visualiser.fxObjects.assets_2D.WindArrow;
|
||||
@@ -127,10 +118,10 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
||||
//sparklineYAxis.setTickMarkVisible(false);
|
||||
|
||||
//positionVbox.getStylesheets().add(getClass().getResource("/css/master.css").toString());
|
||||
raceSparkLine.visibleProperty().setValue(false);
|
||||
raceSparkLine.getYAxis().setAutoRanging(false);
|
||||
sparklineYAxis.setTickMarkVisible(false);
|
||||
positionVbox.getStylesheets().add(getClass().getResource("/css/master.css").toString());
|
||||
// raceSparkLine.visibleProperty().setValue(false);
|
||||
// raceSparkLine.getYAxis().setAutoRanging(false);
|
||||
// sparklineYAxis.setTickMarkVisible(false);
|
||||
// positionVbox.getStylesheets().add(getClass().getResource("/css/master.css").toString());
|
||||
|
||||
//selectAnnotationBtn.setOnAction(event -> loadSelectAnnotationView());
|
||||
// rvAnchorPane.prefWidthProperty().bind(ViewManager.getInstance().getDecorator().widthProperty());
|
||||
@@ -140,28 +131,28 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
||||
// windArrow.setLayoutX(windArrowHolder.getWidth() / 2);
|
||||
// windArrow.setLayoutY(windArrowHolder.getHeight() / 2);
|
||||
|
||||
selectAnnotationBtn.setOnAction(event -> loadSelectAnnotationView());
|
||||
chatInput.lengthProperty().addListener((obs, oldLen, newLen) -> {
|
||||
if (newLen.intValue() > CHAT_LIMIT) {
|
||||
chatInput.setText(chatInput.getText().substring(0, CHAT_LIMIT));
|
||||
}
|
||||
});
|
||||
chatHistory = new ChatHistory();
|
||||
chatHistoryHolder.getChildren().addAll(chatHistory);
|
||||
chatHistory.prefWidthProperty().bind(
|
||||
chatHistoryHolder.widthProperty()
|
||||
);
|
||||
chatHistory.prefHeightProperty().bind(
|
||||
chatHistoryHolder.heightProperty()
|
||||
);
|
||||
// chatHistory.setFitToWidth(true);
|
||||
// chatHistory.setFitToHeight(true);
|
||||
// chatHistory.textProperty().addListener((obs, oldValue, newValue) -> {
|
||||
// chatHistory.setScrollTop(Double.MAX_VALUE);
|
||||
// selectAnnotationBtn.setOnAction(event -> loadSelectAnnotationView());
|
||||
// chatInput.lengthProperty().addListener((obs, oldLen, newLen) -> {
|
||||
// if (newLen.intValue() > CHAT_LIMIT) {
|
||||
// chatInput.setText(chatInput.getText().substring(0, CHAT_LIMIT));
|
||||
// }
|
||||
// });
|
||||
contentGridPane.setOnMouseClicked((event) ->
|
||||
contentGridPane.requestFocus()
|
||||
);
|
||||
// chatHistory = new ChatHistory();
|
||||
// chatHistoryHolder.getChildren().addAll(chatHistory);
|
||||
// chatHistory.prefWidthProperty().bind(
|
||||
// chatHistoryHolder.widthProperty()
|
||||
// );
|
||||
// chatHistory.prefHeightProperty().bind(
|
||||
// chatHistoryHolder.heightProperty()
|
||||
// );
|
||||
//// chatHistory.setFitToWidth(true);
|
||||
//// chatHistory.setFitToHeight(true);
|
||||
//// chatHistory.textProperty().addListener((obs, oldValue, newValue) -> {
|
||||
//// chatHistory.setScrollTop(Double.MAX_VALUE);
|
||||
//// });
|
||||
// contentGridPane.setOnMouseClicked((event) ->
|
||||
// contentGridPane.requestFocus()
|
||||
// );
|
||||
}
|
||||
|
||||
public void loadRace (
|
||||
@@ -711,7 +702,8 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
||||
}
|
||||
|
||||
public boolean isChatInputFocused() {
|
||||
return chatInput.focusedProperty().getValue();
|
||||
// return chatInput.focusedProperty().getValue();
|
||||
return false;
|
||||
}
|
||||
|
||||
public String readChatInput() {
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
package seng302.visualiser.controllers;
|
||||
|
||||
import com.jfoenix.controls.JFXButton;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
import javafx.application.Platform;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
@@ -13,31 +8,16 @@ import javafx.fxml.Initializable;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.effect.DropShadow;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.paint.Color;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ListView;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.ToggleButton;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import seng302.gameServer.ServerAdvertiser;
|
||||
import seng302.gameServer.ServerDescription;
|
||||
import seng302.gameServer.GameState;
|
||||
import seng302.utilities.Sounds;
|
||||
import seng302.visualiser.GameClient;
|
||||
import seng302.visualiser.ServerListener;
|
||||
import seng302.visualiser.ServerListenerDelegate;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.Inet4Address;
|
||||
import java.net.InetAddress;
|
||||
import java.net.NetworkInterface;
|
||||
import java.net.URL;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
@@ -54,50 +34,32 @@ public class StartScreenController implements Initializable{
|
||||
private Logger logger = LoggerFactory.getLogger(StartScreenController.class);
|
||||
|
||||
private List<ServerDescription> servers;
|
||||
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||
Sounds.stopMusic();
|
||||
Sounds.stopSoundEffects();
|
||||
Sounds.playMenuMusic();
|
||||
if (Sounds.isMusicMuted()) {
|
||||
muteMusicButton.setText("UnMute Music");
|
||||
} else {
|
||||
muteMusicButton.setText("Mute Music");
|
||||
}
|
||||
if (Sounds.isSoundEffectsMuted()) {
|
||||
muteSoundsButton.setText("UnMute Sounds");
|
||||
} else {
|
||||
muteSoundsButton.setText("Mute Sounds");
|
||||
}
|
||||
Sounds.setMutes();
|
||||
// gameClient = new GameClient(holder);
|
||||
}
|
||||
private GameClient gameClient;
|
||||
// public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||
// Sounds.stopMusic();
|
||||
// Sounds.stopSoundEffects();
|
||||
// Sounds.playMenuMusic();
|
||||
// if (Sounds.isMusicMuted()) {
|
||||
// muteMusicButton.setText("UnMute Music");
|
||||
// } else {
|
||||
// muteMusicButton.setText("Mute Music");
|
||||
// }
|
||||
// if (Sounds.isSoundEffectsMuted()) {
|
||||
// muteSoundsButton.setText("UnMute Sounds");
|
||||
// } else {
|
||||
// muteSoundsButton.setText("Mute Sounds");
|
||||
// }
|
||||
// Sounds.setMutes();
|
||||
//// gameClient = new GameClient(holder);
|
||||
// }
|
||||
|
||||
private void setInitialDropShadow(){
|
||||
private void setInitialDropShadow() {
|
||||
DropShadow dropShadow = new DropShadow();
|
||||
dropShadow.setRadius(10.0);
|
||||
dropShadow.setOffsetX(3.0);
|
||||
dropShadow.setOffsetY(4.0);
|
||||
dropShadow.setColor(Color.color(0, 0, 0, 0.5));
|
||||
headText.setEffect(dropShadow);
|
||||
/**
|
||||
* Creates an instance of GameClient and runs it as a host.
|
||||
*/
|
||||
@FXML
|
||||
public void hostButtonPressed() {
|
||||
Sounds.playButtonClick();
|
||||
gameClient = new GameClient(holder);
|
||||
gameClient.runAsHost(getLocalHostIp(), 4942);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance of GameClient and runs it has a client.
|
||||
*/
|
||||
@FXML
|
||||
public void connectButtonPressed() {
|
||||
// TODO: 10/07/17 wmu16 - Finish function
|
||||
Sounds.playButtonClick();
|
||||
gameClient = new GameClient(holder);
|
||||
gameClient.runAsClient(ipTextField.getText().trim().toLowerCase(), 4942);
|
||||
}
|
||||
|
||||
private void preloadServerListView(){
|
||||
@@ -132,9 +94,9 @@ public class StartScreenController implements Initializable{
|
||||
Sounds.toggleMuteMusic();
|
||||
Sounds.playButtonClick();
|
||||
if (Sounds.isMusicMuted()) {
|
||||
muteMusicButton.setText("UnMute Music");
|
||||
// muteMusicButton.setText("UnMute Music");
|
||||
} else {
|
||||
muteMusicButton.setText("Mute Music");
|
||||
// muteMusicButton.setText("Mute Music");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,9 +104,9 @@ public class StartScreenController implements Initializable{
|
||||
Sounds.toggleMuteEffects();
|
||||
Sounds.playButtonClick();
|
||||
if (Sounds.isSoundEffectsMuted()) {
|
||||
muteSoundsButton.setText("UnMute Sounds");
|
||||
// muteSoundsButton.setText("UnMute Sounds");
|
||||
} else {
|
||||
muteSoundsButton.setText("Mute Sounds");
|
||||
// muteSoundsButton.setText("Mute Sounds");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import seng302.gameServer.ServerAdvertiser;
|
||||
import seng302.visualiser.GameClient;
|
||||
import seng302.visualiser.controllers.dialogs.BoatCustomizeController;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import seng302.visualiser.controllers.dialogs.BoatCustomizeController;
|
||||
|
||||
public class ViewManager {
|
||||
|
||||
@@ -33,7 +33,6 @@ public class ViewManager {
|
||||
|
||||
private ViewManager(){
|
||||
properties = new HashMap<>();
|
||||
gameClient = new GameClient(decorator);
|
||||
}
|
||||
|
||||
private FXMLLoader loadFxml(String fxmlLocation) {
|
||||
@@ -65,6 +64,7 @@ public class ViewManager {
|
||||
.add(getClass().getResource("/css/master.css").toExternalForm());
|
||||
|
||||
this.decorator = decorator;
|
||||
gameClient = new GameClient(decorator);
|
||||
|
||||
stage.getIcons().add(new Image(getClass().getResourceAsStream("/PP.png")));
|
||||
Scene scene = new Scene(decorator, 1200, 800);
|
||||
@@ -156,8 +156,8 @@ public class ViewManager {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
decorator.getScene().setOnKeyPressed((ke) -> gameClient.keyPressed(ke));
|
||||
decorator.getScene().setOnKeyReleased((ke) -> gameClient.keyReleased(ke));
|
||||
decorator.getScene().setOnKeyPressed(gameClient::keyPressed);
|
||||
decorator.getScene().setOnKeyReleased(gameClient::keyReleased);
|
||||
|
||||
return loader.getController();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user