mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Completed working boat selection screen.
When a user selects a different boat, it is sent to all other clients and updates accordingly. Boats are all shown with their correct models in game. #story[1274]
This commit is contained in:
@@ -11,6 +11,7 @@ import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.scene.Group;
|
||||
import javafx.scene.PointLight;
|
||||
import javafx.scene.layout.Background;
|
||||
import javafx.scene.layout.BackgroundFill;
|
||||
import javafx.scene.layout.CornerRadii;
|
||||
@@ -111,21 +112,35 @@ public class BoatCustomizeController implements Initializable{
|
||||
this.lobbyController = lobbyController;
|
||||
}
|
||||
|
||||
public void setCurrentBoat(BoatMeshType boatType) {
|
||||
public void setCurrentBoat(String boatType) {
|
||||
Group group = new Group();
|
||||
this.currentBoat = boatType;
|
||||
this.currentBoat = BoatMeshType.getBoatMeshType(boatType);
|
||||
System.out.println(boatType.toString());
|
||||
boatPane.setBackground(new Background(new BackgroundFill(Color.SKYBLUE, CornerRadii.EMPTY, Insets.EMPTY)));
|
||||
boatPane.getChildren().add(group);
|
||||
BoatModel bo = ModelFactory.boatCustomiseView(boatType, colorPicker.getValue());
|
||||
BoatModel bo = ModelFactory.boatCustomiseView(currentBoat, colorPicker.getValue());
|
||||
group.getChildren().add(bo.getAssets());
|
||||
group.getChildren().add(new PointLight());
|
||||
}
|
||||
|
||||
public void nextBoat(ActionEvent actionEvent) {
|
||||
boatPane.getChildren().clear();
|
||||
Group group = new Group();
|
||||
boatPane.getChildren().add(group);
|
||||
currentBoat = BoatMeshType.getNextBoatType(currentBoat);
|
||||
BoatModel bo = ModelFactory.boatCustomiseView(currentBoat, colorPicker.getValue());
|
||||
group.getChildren().add(bo.getAssets());
|
||||
group.getChildren().add(new PointLight());
|
||||
}
|
||||
|
||||
public void prevBoat(ActionEvent actionEvent) {
|
||||
boatPane.getChildren().clear();
|
||||
Group group = new Group();
|
||||
boatPane.getChildren().add(group);
|
||||
currentBoat = BoatMeshType.getPrevBoatType(currentBoat);
|
||||
BoatModel bo = ModelFactory.boatCustomiseView(currentBoat, colorPicker.getValue());
|
||||
group.getChildren().add(bo.getAssets());
|
||||
group.getChildren().add(new PointLight());
|
||||
}
|
||||
|
||||
private void RefreshBoat() {
|
||||
|
||||
Reference in New Issue
Block a user