diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/CommunityMapController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/CommunityMapController.java new file mode 100644 index 0000000000000000000000000000000000000000..3dc79401a4a89941e5bcffa4b07dacbb45c14817 --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/CommunityMapController.java @@ -0,0 +1,73 @@ +package de.hdm_stuttgart.battlearena.Controller; + +import de.hdm_stuttgart.battlearena.Controller.Utilities.SceneLoader; +import javafx.beans.property.SimpleStringProperty; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.geometry.Rectangle2D; +import javafx.scene.control.TableColumn; +import javafx.scene.control.TableView; +import javafx.scene.control.cell.PropertyValueFactory; +import javafx.scene.layout.VBox; +import javafx.stage.Screen; + +import java.net.URL; +import java.util.ResourceBundle; + +public class CommunityMapController implements Initializable { + @FXML + private VBox parent; + @FXML + private TableView<DataItem> tableView; + @FXML + private TableColumn<DataItem, String> name; + + Rectangle2D screen = Screen.getPrimary().getVisualBounds(); + + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + tableView.setOnMouseClicked(mouseEvent -> System.out.println(tableView.getWidth())); + setTableView(); + } + + private void setTableView() { + tableView.setMinHeight(screen.getHeight() * 0.69); + tableView.setMinWidth(screen.getWidth() * 0.66); + + name.setCellValueFactory(new PropertyValueFactory<>("name")); + ObservableList<DataItem> data = FXCollections.observableArrayList( + new DataItem("Item A"), + new DataItem("Item B"), + new DataItem("Item C") + ); + + tableView.setItems(data); + } + +// TODO: create map preview + + @FXML + private void backButton() { // for some reason compiler doesn't recognize method usage when 'back' is used as method name. Any other method name works however + parent.getChildren().clear(); + parent.getChildren().add(new SceneLoader().loadScene("MapForge")); + } + +// test values TODO: replace with db + public static class DataItem { + private final SimpleStringProperty name; + + public DataItem(String name) { + this.name = new SimpleStringProperty(name); + } + + public String getName() { + return name.get(); + } + + public SimpleStringProperty nameProperty() { + return name; + } + } +} diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/CreditsController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/CreditsController.java index a6e47b9d714df5d509ec60ac27bd6ac89029fa5f..bd8d67fc8262984ee946d5890286b10d08f2c77f 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/CreditsController.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/CreditsController.java @@ -1,5 +1,7 @@ package de.hdm_stuttgart.battlearena.Controller; +import de.hdm_stuttgart.battlearena.Controller.Utilities.CreateMediaPlayer; +import de.hdm_stuttgart.battlearena.Controller.Utilities.MusicPlayerSingleton; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; @@ -16,9 +18,9 @@ import java.util.ResourceBundle; public class CreditsController implements Initializable { @FXML - public BorderPane parent; + private BorderPane parent; @FXML - public MediaView mediaView; + private MediaView mediaView; private MediaPlayer mediaPlayer; private final File file = new File("src/main/resources/videos/credits.mp4"); @@ -31,7 +33,7 @@ public class CreditsController implements Initializable { } private void createMediaPlayer() { - mediaPlayer = new CreateMediaPlayer().getMediaPlayer(mediaView, file, parent); + mediaPlayer = new CreateMediaPlayer().getMediaPlayer(mediaView, file, true, parent); mediaView.setMediaPlayer(mediaPlayer); mediaPlayer.setOnEndOfMedia(this::videoEnd); diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/IntroController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/IntroController.java index 7a77864cb6349989b9ee99f84e56f98932683146..2c4472104e35751cedb56601d0b5f6b13f72e278 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/IntroController.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/IntroController.java @@ -1,5 +1,6 @@ package de.hdm_stuttgart.battlearena.Controller; +import de.hdm_stuttgart.battlearena.Controller.Utilities.CreateMediaPlayer; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; @@ -17,9 +18,9 @@ import java.util.ResourceBundle; public class IntroController implements Initializable { @FXML - public MediaView mediaView; + private MediaView mediaView; @FXML - public BorderPane introParent; + private BorderPane introParent; private final String fileName = "src/main/resources/videos/"; // nextVideo() will iterate through this array so the next video will be played TODO: change the videos to non memes lmao private final String[] videos = {"sony.mp4", "gamecube.mp4", "gameboy.mp4", "monke.mp4"}; @@ -36,7 +37,7 @@ public class IntroController implements Initializable { private void createMediaPlayer() { // initializing this.mediaPlayer - mediaPlayer = new CreateMediaPlayer().getMediaPlayer(mediaView, file, introParent); + mediaPlayer = new CreateMediaPlayer().getMediaPlayer(mediaView, file, true, introParent); mediaView.setMediaPlayer(mediaPlayer); mediaPlayer.setOnEndOfMedia(() -> { @@ -58,9 +59,10 @@ public class IntroController implements Initializable { } private void videoEnd() { +// TODO: check if player exists try { mediaPlayer.dispose(); - introParent.getScene().setRoot(FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/MenuBorderPane.fxml")))); + introParent.getScene().setRoot(FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/PlayerCreateScene.fxml")))); } catch (IOException e) { throw new RuntimeException(); } diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/LocalCreateController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/LocalCreateController.java index 12f6d654caa5d116dbb0d6be8fcf8b03d25747f8..69b2cb5b336306ffa11e72ad169745d1c83c9cd4 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/LocalCreateController.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/LocalCreateController.java @@ -1,23 +1,44 @@ package de.hdm_stuttgart.battlearena.Controller; +import de.hdm_stuttgart.battlearena.Controller.Utilities.SceneLoader; import javafx.fxml.FXML; -import javafx.fxml.FXMLLoader; +import javafx.fxml.Initializable; +import javafx.scene.control.TitledPane; +import javafx.scene.control.ToggleButton; +import javafx.scene.control.ToggleGroup; import javafx.scene.layout.VBox; -import java.io.IOException; -import java.util.Objects; +import java.net.URL; +import java.util.ResourceBundle; -public class LocalCreateController { - @FXML public VBox parent; +public class LocalCreateController implements Initializable { + @FXML + private VBox parent; + @FXML + private TitledPane roundsTitledPane; + @FXML + private ToggleGroup rounds; private final SceneLoader sceneLoader = new SceneLoader(); - public void playScene() { + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + rounds.selectedToggleProperty().addListener((observableValue, oldToggle, newToggle) -> { + if (rounds.getSelectedToggle() != null) { + ToggleButton selected = (ToggleButton) rounds.getSelectedToggle(); + roundsTitledPane.setText(selected.getText()); + } + }); + } + @FXML + private void backButton() { parent.getChildren().clear(); parent.getChildren().add(sceneLoader.loadScene("Play")); } - public void skinSelectionScene() { + @FXML + private void skinSelectionScene() { parent.getChildren().clear(); parent.getChildren().add(sceneLoader.loadScene("SkinSelection")); } + } diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/MainMenuController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/MainMenuController.java index 5a8c9dea297cc86f74b13911c31a9318d66f6178..c71e7fc4804f06df9f0249a24e102b057c55ba7a 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/MainMenuController.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/MainMenuController.java @@ -1,38 +1,62 @@ package de.hdm_stuttgart.battlearena.Controller; +import de.hdm_stuttgart.battlearena.Controller.Utilities.SceneLoader; import javafx.fxml.FXML; +import javafx.fxml.Initializable; import javafx.scene.control.Button; import javafx.scene.layout.VBox; +import javafx.stage.Screen; import javafx.stage.Stage; -public class MainMenuController { +import java.net.URL; +import java.util.ResourceBundle; + +public class MainMenuController implements Initializable { @FXML - public VBox parent; + private VBox parent; @FXML - public Button exitButton; + private Button exitButton; private final SceneLoader sceneLoader = new SceneLoader(); private void switchScene(String name) { parent.getChildren().clear(); parent.getChildren().add(sceneLoader.loadScene(name)); } - public void playScene() { + + @FXML + private void playScene() { switchScene("Play"); } - public void statisticsScene() { + @FXML + private void mapScene() { + switchScene("MapForge"); + } + + @FXML + private void statisticsScene() { switchScene("Statistics"); } - public void optionsScene() { - switchScene("Options"); + @FXML + private void settingsScene() { + switchScene("Settings"); } - public void exit() { + @FXML + private void exit() { Stage stage = (Stage) exitButton.getScene().getWindow(); stage.close(); } - -// TODO: create skin selection scene + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + Screen screen = Screen.getPrimary(); + if (screen.getDpi() >= 119) { + parent.setSpacing(30); + parent.setStyle("-fx-font-size: 40"); + } else { + parent.setStyle("-fx-font-size: 50"); + } + } } diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/MapForgeController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/MapForgeController.java new file mode 100644 index 0000000000000000000000000000000000000000..7f57a6dd566a493f12e2c9ffdea4772df823f130 --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/MapForgeController.java @@ -0,0 +1,51 @@ +package de.hdm_stuttgart.battlearena.Controller; + +import de.hdm_stuttgart.battlearena.Controller.Utilities.MusicPlayerSingleton; +import de.hdm_stuttgart.battlearena.Controller.Utilities.SceneLoader; +import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; +import javafx.scene.layout.VBox; + +import java.io.IOException; +import java.util.Objects; + +public class MapForgeController { + @FXML + private VBox parent; + SceneLoader sceneLoader = new SceneLoader(); + + @FXML + private void mapEditorScene() { + try { + parent.getScene().setRoot(FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/PlayerCreateScene.fxml")))); + MusicPlayerSingleton.getInstance().getMediaPlayer().dispose(); + } catch (IOException e) { + throw new RuntimeException(); + } + } + + @FXML + private void communityMapScene() { + switchScene("CommunityMaps"); + } + + @FXML + private void updateMapScene() { + try { + parent.getScene().setRoot(FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/PlayerCreateScene.fxml")))); + MusicPlayerSingleton.getInstance().getMediaPlayer().dispose(); + } catch (IOException e) { + throw new RuntimeException(); + } + } + + @FXML + private void backButton() { + switchScene("MainMenu"); + } + + private void switchScene(String name) { + parent.getChildren().clear(); + parent.getChildren().add(sceneLoader.loadScene(name)); + } +} diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/MenuBorderPaneController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/MenuBorderPaneController.java index 6f980d5271853b580f31e74f3b3cac3ea1a9758d..81b05ca9a8de2670edb504e78a78fb3e20ca2ebd 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/MenuBorderPaneController.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/MenuBorderPaneController.java @@ -1,11 +1,15 @@ package de.hdm_stuttgart.battlearena.Controller; +import de.hdm_stuttgart.battlearena.Controller.Utilities.CreateMediaPlayer; +import de.hdm_stuttgart.battlearena.Controller.Utilities.MusicPlayerSingleton; +import de.hdm_stuttgart.battlearena.Controller.Utilities.SceneLoader; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.geometry.Rectangle2D; import javafx.scene.control.Button; import javafx.scene.image.ImageView; import javafx.scene.layout.BorderPane; +import javafx.scene.layout.StackPane; import javafx.scene.media.Media; import javafx.scene.media.MediaPlayer; import javafx.scene.media.MediaView; @@ -13,49 +17,91 @@ import javafx.stage.Screen; import java.io.File; import java.net.URL; -import java.util.ResourceBundle; +import java.util.*; public class MenuBorderPaneController implements Initializable { - // TODO: change FXML variables to private. Don't know why it's not working when they're private @FXML - public BorderPane parent; + private BorderPane parent; @FXML - public Button btnRight; + private Button btnRight, btnLeft; @FXML - public ImageView imgLeft, imgRight; - private int counter = 1; + private ImageView imgLeft, imgRight; + @FXML + private StackPane center; + private int musicCounter = 1, videoCounter = 0; private final SceneLoader sceneLoader = new SceneLoader(); - MediaPlayer musicPlayer; + private MediaPlayer musicPlayer, mediaPlayer; + private MediaView mediaView; + private final String[] videoFiles = {"depression", "allMyFellas", "wooOOoo", "myMind", "dogCheese", "gta", "cat", "bobama", "roomba", "firework", "cheezburger", + "kangaroo", "lifeCouldBeMonke", "seal", "imNotYou", "parkingTickets", "russianKid", "rejectHumanity", "horse", "catSitting", "pablo", "holyCrap", + "lessGoo", "sadCat", "basketball", "yoinkySploinky", "msPuff", "=D", "banana", "chaCha", "async", "sadHorse", "minecraftCat", "muecke", "top10Cats", "dog", + "pot", "mineCraftCat2", "catEating", "bear", "pancake", "frog", "gtfo", "carl", "dog2", "slippery", "wolf", "legCat", "sad", "waaahhh"}; + + List<String> shuffledVideos = Arrays.asList(videoFiles); + Rectangle2D screen = Screen.getPrimary().getVisualBounds(); @Override public void initialize(URL url, ResourceBundle resourceBundle) { - parent.setCenter(sceneLoader.loadScene("MainMenu")); + center.getChildren().add(sceneLoader.loadScene("MainMenu")); // set size for rusty gear image depending on screen resolution - Rectangle2D screen = Screen.getPrimary().getVisualBounds(); final double imageWidth = screen.getWidth() / 6; imgRight.setFitWidth(imageWidth); imgRight.setPreserveRatio(true); imgLeft.setFitWidth(imageWidth); imgLeft.setPreserveRatio(true); + backgroundMusic("cocBackgroundMusicTest.mp3"); + easterEgg(); + +// shuffle meme order + Collections.shuffle(shuffledVideos); } - public void easterEgg() { - btnRight.setOnMouseClicked(mouseEvent -> counter++); - switch (counter) { - case 5: - musicPlayer.dispose(); - backgroundMusic("spongeBob.mp3"); - break; - case 12: - musicPlayer.dispose(); - backgroundMusic("stadiumRave.mp3"); - break; - case 20: - musicPlayer.dispose(); - backgroundMusic("wii.mp3"); - break; - } + private void easterEgg() { + btnRight.setOnMouseClicked(mouseEvent -> { + System.out.println(center.getWidth()); + musicCounter++; + switch (musicCounter) { + case 5: + musicPlayer.dispose(); + backgroundMusic("spongeBob.mp3"); + break; + case 12: + musicPlayer.dispose(); + backgroundMusic("stadiumRave.mp3"); + break; + case 20: + musicPlayer.dispose(); + backgroundMusic("wii.mp3"); + break; + } + }); + + btnLeft.setOnMouseClicked(mouseEvent -> { +// make background music continue play after there is no meme left + if (!musicPlayer.isAutoPlay()) { + musicPlayer.play(); + } + +// if a meme is already running, current mediaPlayer will be removed + if (mediaPlayer != null) { + mediaPlayer.dispose(); + center.getChildren().remove(mediaView); + } + + if (videoCounter < videoFiles.length) { + String nextVideo = shuffledVideos.get(videoCounter); + musicPlayer.stop(); + mediaPlayer = new CreateMediaPlayer().getMediaPlayer(mediaView, new File("src/main/resources/videos/" + nextVideo + ".mp4"), false); + mediaView = new MediaView(mediaPlayer); + center.getChildren().add(mediaView); + mediaPlayer.setOnEndOfMedia(() -> { + center.getChildren().remove(mediaView); + musicPlayer.play(); + }); + } + videoCounter++; + }); } private void backgroundMusic(String file) { diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/MultiplayerController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/MultiplayerController.java index c0398758ef90f8af93860a24e7706c04f3293035..181688fec0dda599c2b0f7e6b08177dc93913e80 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/MultiplayerController.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/MultiplayerController.java @@ -1,24 +1,31 @@ package de.hdm_stuttgart.battlearena.Controller; +import de.hdm_stuttgart.battlearena.Controller.Utilities.SceneLoader; import javafx.fxml.FXML; import javafx.scene.layout.VBox; public class MultiplayerController { - @FXML public VBox parent; + @FXML + private VBox parent; private final SceneLoader sceneLoader = new SceneLoader(); - public void multiplayerCreateScene() { - parent.getChildren().clear(); - parent.getChildren().add(sceneLoader.loadScene("MultiplayerCreate")); + @FXML + private void multiplayerCreateScene() { + switchScene("MultiplayerCreate"); } - public void multiplayerJoinScene() { - parent.getChildren().clear(); - parent.getChildren().add(sceneLoader.loadScene("MultiplayerJoin")); + @FXML + private void multiplayerJoinScene() { + switchScene("MultiplayerJoin"); + } + + @FXML + private void backButton() { + switchScene("Play"); } - public void playScene() { + private void switchScene(String name) { parent.getChildren().clear(); - parent.getChildren().add(sceneLoader.loadScene("Play")); + parent.getChildren().add(sceneLoader.loadScene(name)); } } diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/MultiplayerCreateController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/MultiplayerCreateController.java index 3791d1b65442c4156ceed67abdabcd15d0459d64..6db97dfe730df0204ee53741f896e596fce5ebfe 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/MultiplayerCreateController.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/MultiplayerCreateController.java @@ -1,13 +1,16 @@ package de.hdm_stuttgart.battlearena.Controller; +import de.hdm_stuttgart.battlearena.Controller.Utilities.SceneLoader; import javafx.fxml.FXML; import javafx.scene.layout.VBox; public class MultiplayerCreateController { - @FXML public VBox parent; + @FXML + private VBox parent; private final SceneLoader sceneLoader = new SceneLoader(); - public void multiplayerScene() { + @FXML + private void backButton() { parent.getChildren().clear(); parent.getChildren().add(sceneLoader.loadScene("Multiplayer")); } diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/MultiplayerJoinController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/MultiplayerJoinController.java index e6acf0f92a50714ee0e1a152a24ea0b6999ada31..0aefd1003845e6971d2a025ba5d13c48cf257a33 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/MultiplayerJoinController.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/MultiplayerJoinController.java @@ -1,13 +1,16 @@ package de.hdm_stuttgart.battlearena.Controller; +import de.hdm_stuttgart.battlearena.Controller.Utilities.SceneLoader; import javafx.fxml.FXML; import javafx.scene.layout.VBox; public class MultiplayerJoinController { - @FXML public VBox parent; + @FXML + private VBox parent; private final SceneLoader sceneLoader = new SceneLoader(); - public void multiplayerScene() { + @FXML + private void backButton() { parent.getChildren().clear(); parent.getChildren().add(sceneLoader.loadScene("Multiplayer")); } diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/OptionsController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/OptionsController.java deleted file mode 100644 index 6cba2a46980f3f81abb00e59b69bb6b4666104f4..0000000000000000000000000000000000000000 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/OptionsController.java +++ /dev/null @@ -1,45 +0,0 @@ -package de.hdm_stuttgart.battlearena.Controller; - -import javafx.fxml.FXML; -import javafx.fxml.FXMLLoader; -import javafx.fxml.Initializable; -import javafx.scene.control.Slider; -import javafx.scene.layout.VBox; - -import java.io.IOException; -import java.net.URL; -import java.util.Objects; -import java.util.ResourceBundle; - -public class OptionsController implements Initializable { - @FXML public VBox parent; - @FXML public Slider volumeSlider; - SceneLoader sceneLoader = new SceneLoader(); - public double volume; - MusicPlayerSingleton musicPlayer = MusicPlayerSingleton.getInstance(); - - public void creditScene() throws IOException { - parent.getChildren().clear(); - parent.getScene().setRoot(FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/credits.fxml")))); - } - - public void mainMenuScene() { - parent.getChildren().clear(); - parent.getChildren().add(sceneLoader.loadScene("MainMenu")); - } - - @Override - public void initialize(URL url, ResourceBundle resourceBundle) { - setVolume(); - } - - private void setVolume() { -// need a runtime database to save volume - volumeSlider.valueProperty().addListener((observableValue, oldValue, newValue) -> { - musicPlayer.getMediaPlayer().setVolume(volume); - volume = newValue.doubleValue() / 100; - musicPlayer.getMediaPlayer().setVolume(volume); - System.out.println(volume); - }); - } -} diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/PlayController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/PlayController.java index 0b094a0e03c9fcf123fca334bd59b96f09bd719c..eae49e623cc42da45d01a9e19f7d0432c920ae59 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/PlayController.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/PlayController.java @@ -1,24 +1,31 @@ package de.hdm_stuttgart.battlearena.Controller; +import de.hdm_stuttgart.battlearena.Controller.Utilities.SceneLoader; import javafx.fxml.FXML; import javafx.scene.layout.VBox; public class PlayController { - @FXML public VBox parent; + @FXML + private VBox parent; private final SceneLoader sceneLoader = new SceneLoader(); - public void mainMenuScene() { - parent.getChildren().clear(); - parent.getChildren().add(sceneLoader.loadScene("MainMenu")); + @FXML + private void backButton() { + switchScene("MainMenu"); } - public void localScene() { - parent.getChildren().clear(); - parent.getChildren().add(sceneLoader.loadScene("LocalCreate")); + @FXML + private void localScene() { + switchScene("LocalCreate"); + } + + @FXML + private void multiplayerScene() { + switchScene("Multiplayer"); } - public void multiplayerScene() { + private void switchScene(String name) { parent.getChildren().clear(); - parent.getChildren().add(sceneLoader.loadScene("Multiplayer")); + parent.getChildren().add(sceneLoader.loadScene(name)); } } diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/PlayerCreateController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/PlayerCreateController.java new file mode 100644 index 0000000000000000000000000000000000000000..68dfd4029aad7452c5d19d82fdfcaec3f0e8435e --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/PlayerCreateController.java @@ -0,0 +1,51 @@ +package de.hdm_stuttgart.battlearena.Controller; + +import de.hdm_stuttgart.battlearena.Controller.Utilities.CreateMediaPlayer; +import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; +import javafx.fxml.Initializable; +import javafx.scene.control.Button; +import javafx.scene.layout.BorderPane; +import javafx.scene.media.Media; +import javafx.scene.media.MediaPlayer; +import javafx.scene.media.MediaView; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.Objects; +import java.util.ResourceBundle; + +public class PlayerCreateController implements Initializable { + @FXML + private BorderPane parent; + @FXML + private MediaView mediaView; + @FXML + private Button button; + private MediaPlayer mediaPlayer, musicPlayer; + + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + File file = new File("src/main/resources/videos/construction.mp4"); + mediaPlayer = new CreateMediaPlayer().getMediaPlayer(mediaView, file, true, parent); + mediaView.setMediaPlayer(mediaPlayer); + mediaPlayer.setCycleCount(MediaPlayer.INDEFINITE); + parent.setStyle("-fx-font-size: 50; -fx-text-fill: white; -fx-font-family: 'Arial Black'"); + + Media musicMedia = new Media(new File("src/main/resources/sound/music/constructionJazz.mp3").toURI().toString()); + musicPlayer = new MediaPlayer(musicMedia); + musicPlayer.setCycleCount(MediaPlayer.INDEFINITE); + musicPlayer.setAutoPlay(true); + + button.setOnMouseClicked(mouseEvent -> { + try { + mediaPlayer.dispose(); + musicPlayer.dispose(); + parent.getScene().setRoot(FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/MenuBorderPane.fxml")))); + } catch (IOException e) { + throw new RuntimeException(); + } + }); + } +} diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/SettingsController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/SettingsController.java new file mode 100644 index 0000000000000000000000000000000000000000..a3c7526665111d073af465d5c74599952442b63b --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/SettingsController.java @@ -0,0 +1,56 @@ +package de.hdm_stuttgart.battlearena.Controller; + +import de.hdm_stuttgart.battlearena.Controller.Utilities.MusicPlayerSingleton; +import de.hdm_stuttgart.battlearena.Controller.Utilities.SceneLoader; +import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; +import javafx.fxml.Initializable; +import javafx.scene.control.Slider; +import javafx.scene.layout.VBox; + +import java.io.IOException; +import java.net.URL; +import java.util.Objects; +import java.util.ResourceBundle; + +public class SettingsController implements Initializable { + @FXML + private VBox parent; + @FXML + private Slider musicVolume, sfxVolume; + SceneLoader sceneLoader = new SceneLoader(); + public double music; + MusicPlayerSingleton musicPlayer = MusicPlayerSingleton.getInstance(); + + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + setMusicVolume(); + } + + @FXML + private void creditScene() throws IOException { + parent.getChildren().clear(); + parent.getScene().setRoot(FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/credits.fxml")))); + } + + @FXML + private void backButton() { + parent.getChildren().clear(); + parent.getChildren().add(sceneLoader.loadScene("MainMenu")); + } + + private void setMusicVolume() { +// need a runtime database to save volume + musicVolume.valueProperty().addListener((observableValue, oldValue, newValue) -> { + setMusic(musicVolume); + System.out.println(music); + }); + } + + private void setMusic(Slider slider) { + slider.valueProperty().addListener(((observableValue, oldValue, newValue) -> { + music = newValue.doubleValue() / 100; + musicPlayer.getMediaPlayer().setVolume(music); + })); + } +} diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/SkinSelectionController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/SkinSelectionController.java index 531d6229fdfc5b15342a14f662977cecff1d4f2e..6015655a06d8dad0530362087a84c6e87e646f57 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/SkinSelectionController.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/SkinSelectionController.java @@ -1,11 +1,16 @@ package de.hdm_stuttgart.battlearena.Controller; +import de.hdm_stuttgart.battlearena.Controller.Utilities.MusicPlayerSingleton; +import de.hdm_stuttgart.battlearena.Controller.Utilities.SceneLoader; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; +import javafx.geometry.Rectangle2D; import javafx.scene.control.ToggleButton; import javafx.scene.control.ToggleGroup; +import javafx.scene.image.ImageView; import javafx.scene.layout.VBox; +import javafx.stage.Screen; import java.io.IOException; import java.net.URL; @@ -13,8 +18,12 @@ import java.util.Objects; import java.util.ResourceBundle; public class SkinSelectionController implements Initializable { - @FXML public VBox parent; - @FXML public ToggleGroup selectionButton; + @FXML + private VBox parent; + @FXML + private ToggleGroup selectionButton; + @FXML + private ImageView selection1, selection2, selection3; @Override public void initialize(URL url, ResourceBundle resourceBundle) { @@ -25,10 +34,26 @@ public class SkinSelectionController implements Initializable { System.out.println(value); } }); + setImageWidth(selection1, selection2, selection3); + } + private void setImageWidth(ImageView... imageViews) { // the ... allows for zero or more arguments seperated by a comma, will pass argument as an array + Rectangle2D screen = Screen.getPrimary().getVisualBounds(); + final double imageWidth = screen.getWidth() * 0.2; + for (ImageView image : imageViews) { + image.setFitWidth(imageWidth); + image.setPreserveRatio(true); + } + } + + @FXML + private void backButton() { + parent.getChildren().clear(); + parent.getChildren().add(new SceneLoader().loadScene("LocalCreate")); } - public void gameScene() { + @FXML + private void gameScene() { try { MusicPlayerSingleton.getInstance().getMediaPlayer().dispose(); parent.getScene().setRoot(FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/GameScene.fxml")))); @@ -36,9 +61,4 @@ public class SkinSelectionController implements Initializable { throw new RuntimeException(); } } - - public void back() { - parent.getChildren().clear(); - parent.getChildren().add(new SceneLoader().loadScene("LocalCreate")); - } } diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/StatisticsController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/StatisticsController.java index f591bfa15ef9a643f91fe59dc3c8c3482b085e8a..009c8a94b5f4a68c3c1b21ddcf194621be698a9c 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/StatisticsController.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/StatisticsController.java @@ -1,5 +1,6 @@ package de.hdm_stuttgart.battlearena.Controller; +import de.hdm_stuttgart.battlearena.Controller.Utilities.SceneLoader; import javafx.beans.binding.Bindings; import javafx.collections.FXCollections; import javafx.collections.ObservableList; @@ -14,9 +15,12 @@ import java.util.ResourceBundle; public class StatisticsController implements Initializable { - @FXML public Text blocks, deaths, gameTime, gamesLost, gamesWon, kills; - @FXML public VBox parent; - @FXML public PieChart kd, wl; + @FXML + private Text blocks, deaths, gameTime, gamesLost, gamesWon, kills; + @FXML + private VBox parent; + @FXML + private PieChart kd, wl; SceneLoader sceneLoader = new SceneLoader(); public void mainMenuScene() { @@ -24,36 +28,40 @@ public class StatisticsController implements Initializable { parent.getChildren().add(sceneLoader.loadScene("MainMenu")); } - public void initialize(URL url, ResourceBundle resourceBundle){ + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { iniPieChartkd(); iniPieChartwl(); + kd.setLegendVisible(false); + wl.setLegendVisible(false); } public void iniPieChartkd() { ObservableList<PieChart.Data> pieChartData = FXCollections.observableArrayList( - new PieChart.Data("Kills",20), - new PieChart.Data("Deaths",12)); - - pieChartData.forEach(data -> - data.nameProperty().bind( - Bindings.concat( - data.getName(),": ", data.pieValueProperty() - ) - ) - ); - kd.getData().addAll(pieChartData); + new PieChart.Data("Kills", 20), + new PieChart.Data("Deaths", 12)); + + pieChartData.forEach(data -> + data.nameProperty().bind( + Bindings.concat( + data.getName(), ": ", data.pieValueProperty() + ) + ) + ); + kd.getData().addAll(pieChartData); } + public void iniPieChartwl() { ObservableList<PieChart.Data> pieChartData = FXCollections.observableArrayList( - new PieChart.Data("Wins",3), - new PieChart.Data("Losses",5)); + new PieChart.Data("Wins", 3), + new PieChart.Data("Losses", 5)); pieChartData.forEach(data -> data.nameProperty().bind( Bindings.concat( - data.getName(),": ", data.pieValueProperty() + data.getName(), ": ", data.pieValueProperty() ) ) ); diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/ButtonTransition.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/ButtonTransition.java similarity index 94% rename from src/main/java/de/hdm_stuttgart/battlearena/Controller/ButtonTransition.java rename to src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/ButtonTransition.java index 2af6c6d63c35c91301dfd68eab22027ced9fdcbc..b129d469320cdd8549e234a3a5d6fae8901187ea 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/ButtonTransition.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/ButtonTransition.java @@ -1,4 +1,4 @@ -package de.hdm_stuttgart.battlearena.Controller; +package de.hdm_stuttgart.battlearena.Controller.Utilities; import javafx.animation.ScaleTransition; import javafx.scene.control.Button; diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/CreateMediaPlayer.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/CreateMediaPlayer.java similarity index 58% rename from src/main/java/de/hdm_stuttgart/battlearena/Controller/CreateMediaPlayer.java rename to src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/CreateMediaPlayer.java index 03fbd835e1a457c5f9ad0fdd649d747840a240fd..4bf6c165db835d9908078118b40628cbfbc2350a 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/CreateMediaPlayer.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/CreateMediaPlayer.java @@ -1,4 +1,4 @@ -package de.hdm_stuttgart.battlearena.Controller; +package de.hdm_stuttgart.battlearena.Controller.Utilities; import javafx.scene.layout.BorderPane; import javafx.scene.media.Media; @@ -8,15 +8,17 @@ import javafx.scene.media.MediaView; import java.io.File; public class CreateMediaPlayer { - public MediaPlayer getMediaPlayer(MediaView mediaView, File file, BorderPane parent) { + public MediaPlayer getMediaPlayer(MediaView mediaView, File file, boolean isFullscreen, BorderPane... parent) { Media media = new Media(file.toURI().toString()); MediaPlayer mediaPlayer = new MediaPlayer(media); // resizing once the scenes has been loaded to get width and height property - mediaPlayer.setOnReady(() -> { - mediaView.fitWidthProperty().bind(parent.getScene().widthProperty()); - mediaView.fitHeightProperty().bind(parent.getScene().heightProperty()); - }); + if (isFullscreen) { + mediaPlayer.setOnReady(() -> { + mediaView.fitWidthProperty().bind(parent[0].getScene().widthProperty()); + mediaView.fitHeightProperty().bind(parent[0].getScene().heightProperty()); + }); + } mediaPlayer.setAutoPlay(true); return mediaPlayer; } diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/MusicPlayerSingleton.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/MusicPlayerSingleton.java similarity index 90% rename from src/main/java/de/hdm_stuttgart/battlearena/Controller/MusicPlayerSingleton.java rename to src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/MusicPlayerSingleton.java index 5653a7c8cbca3e0278568d08fcda7dc7e1712c17..df8991982ff1b19ed4442b9e541b85b1d27397a4 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/MusicPlayerSingleton.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/MusicPlayerSingleton.java @@ -1,4 +1,4 @@ -package de.hdm_stuttgart.battlearena.Controller; +package de.hdm_stuttgart.battlearena.Controller.Utilities; import javafx.scene.media.MediaPlayer; public class MusicPlayerSingleton { diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/SceneLoader.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/SceneLoader.java similarity index 93% rename from src/main/java/de/hdm_stuttgart/battlearena/Controller/SceneLoader.java rename to src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/SceneLoader.java index 0d5a04ef5789505821f173c05997a43313b8b33d..8c0e8b4a9487316777dd42b0823e07b737386208 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/SceneLoader.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/SceneLoader.java @@ -1,4 +1,4 @@ -package de.hdm_stuttgart.battlearena.Controller; +package de.hdm_stuttgart.battlearena.Controller.Utilities; import javafx.fxml.FXMLLoader; import javafx.scene.layout.Pane; diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/ScreenClasses.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/ScreenClasses.java new file mode 100644 index 0000000000000000000000000000000000000000..469d628a724f3761c23b14fc85f602966e3d0720 --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/ScreenClasses.java @@ -0,0 +1,28 @@ +package de.hdm_stuttgart.battlearena.Controller.Utilities; + +public enum ScreenClasses { +// enums have a range because the screen calculations are not precise, especially with screen scaling in the OS settings + INCH27(26, 28), + INCH24(23, 25), + INCH13_SURFACE(12, 14); + + final int lBound, uBound; + + ScreenClasses(int lBound, int uBound) { + this.lBound = lBound; + this.uBound = uBound; + } + + public static ScreenClasses inRange(int inches) { + for (ScreenClasses screens : ScreenClasses.values()) { + if (screens.isInRange(inches)) { + return screens; + } + } + return null; + } + + private boolean isInRange(int inches) { + return inches >= lBound && inches <= uBound; + } +} diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/ScreenDimensionCalculator.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/ScreenDimensionCalculator.java new file mode 100644 index 0000000000000000000000000000000000000000..4dee18cfe414ec04cc2323954e0ae0d77a128902 --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/ScreenDimensionCalculator.java @@ -0,0 +1,12 @@ +package de.hdm_stuttgart.battlearena.Controller.Utilities; + +public class ScreenDimensionCalculator { + public double calculateDiagonalInches(double width, double height, double dpi) { + double diagonalPixels = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)); + double diagonalInches = diagonalPixels / dpi; + System.out.println("diagonal pixels: " + diagonalPixels); + System.out.println("width: " + width); + System.out.println("height: " + height); + return diagonalInches; + } +} diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/ToggleButtonTransition.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/ToggleButtonTransition.java similarity index 96% rename from src/main/java/de/hdm_stuttgart/battlearena/Controller/ToggleButtonTransition.java rename to src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/ToggleButtonTransition.java index 6ee839dddf70e1a34ac776b9343e068234b391ab..94d51e4b2524cc0428678adadcf57b01e61dd643 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Controller/ToggleButtonTransition.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/Utilities/ToggleButtonTransition.java @@ -1,4 +1,4 @@ -package de.hdm_stuttgart.battlearena.Controller; +package de.hdm_stuttgart.battlearena.Controller.Utilities; import javafx.animation.FadeTransition; import javafx.scene.control.ToggleButton; diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Main/Main.java b/src/main/java/de/hdm_stuttgart/battlearena/Main/Main.java index d222017ae825e1a18482ab3913991df51d2df7bf..5ba11eb60e0f13ae13883241d2a96279e5f58025 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Main/Main.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Main/Main.java @@ -6,6 +6,7 @@ import javafx.fxml.FXMLLoader; import javafx.geometry.Rectangle2D; import javafx.scene.Parent; import javafx.scene.Scene; +import javafx.scene.image.Image; import javafx.scene.text.Font; import javafx.stage.Screen; import javafx.stage.Stage; @@ -30,8 +31,9 @@ public class Main extends Application { @Override public void start(Stage stage) throws Exception { // loading font in start() because CSS can't handle whitespace in folder names - Font.loadFont(getClass().getResourceAsStream("/fonts/StarshipShadow.ttf"), 20); + Font.loadFont(getClass().getResourceAsStream("/fonts/StarshipShadow.ttf"), 50); +// TODO: revert back to intro scene Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/Intro.fxml"))); Scene scene = new Scene(root); @@ -40,6 +42,7 @@ public class Main extends Application { scene.setOnKeyReleased(inputHandler::handleKeyRelease); stage.setTitle("BattleArena"); + stage.getIcons().add(new Image("file:src/main/resources/textures/images/icon.png")); stage.setScene(scene); stage.minHeightProperty().setValue(400); stage.minWidthProperty().setValue(600); diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 709ade468a755a08cdc96ccb0e622f9f5e6effc6..2350a517d6af6b0318a876694b89460514fc8e56 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -15,5 +15,10 @@ module gui { opens de.hdm_stuttgart.battlearena.Model.DataStorage.Classes.Utilities to com.google.gson; exports de.hdm_stuttgart.battlearena.Main; exports de.hdm_stuttgart.battlearena.Controller; + exports de.hdm_stuttgart.battlearena.Model.Entity; + exports de.hdm_stuttgart.battlearena.Model.Inputs; + exports de.hdm_stuttgart.battlearena.Model.Map; + exports de.hdm_stuttgart.battlearena.Controller.Utilities; exports de.hdm_stuttgart.battlearena.Model.Multiplayer; -} + opens de.hdm_stuttgart.battlearena.Controller.Utilities to javafx.fxml; +} \ No newline at end of file diff --git a/src/main/resources/fxml/CommunityMaps.fxml b/src/main/resources/fxml/CommunityMaps.fxml new file mode 100644 index 0000000000000000000000000000000000000000..4c421873024cca71de548b0cf6ba3498472f6594 --- /dev/null +++ b/src/main/resources/fxml/CommunityMaps.fxml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import javafx.scene.control.Button?> +<?import javafx.scene.control.TableColumn?> +<?import javafx.scene.control.TableView?> +<?import javafx.scene.layout.HBox?> +<?import javafx.scene.layout.VBox?> + +<VBox fx:id="parent" alignment="CENTER" prefHeight="400.0" prefWidth="600.0" stylesheets="@../styles/style.css" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hdm_stuttgart.battlearena.Controller.CommunityMapController"> + <children> + <TableView fx:id="tableView" editable="true" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" VBox.vgrow="ALWAYS"> + <columns> + <TableColumn editable="false" prefWidth="75.0" text="ID" /> + <TableColumn fx:id="name" editable="false" prefWidth="75.0" text="Name" /> + <TableColumn editable="false" prefWidth="75.0" text="Width" /> + <TableColumn editable="false" prefWidth="75.0" text="Height" /> + <TableColumn editable="false" prefWidth="75.0" text="Downloads" /> + </columns> + <columnResizePolicy> + <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> + </columnResizePolicy> + </TableView> + <HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" spacing="20.0" VBox.vgrow="ALWAYS"> + <children> + <Button mnemonicParsing="false" onAction="#backButton" text="Back" /> + <Button mnemonicParsing="false" text="Load" /> + </children> + </HBox> + </children> +</VBox> diff --git a/src/main/resources/fxml/LocalCreate.fxml b/src/main/resources/fxml/LocalCreate.fxml index 46cca9f8e1e83c60b4a7c8cbc9753d9083bee1a0..f100d9b68a8eab3fc0d6554e02f8cbd29cd16373 100644 --- a/src/main/resources/fxml/LocalCreate.fxml +++ b/src/main/resources/fxml/LocalCreate.fxml @@ -4,7 +4,9 @@ <?import javafx.scene.control.Accordion?> <?import javafx.scene.control.Button?> <?import javafx.scene.control.RadioButton?> +<?import javafx.scene.control.ScrollPane?> <?import javafx.scene.control.TitledPane?> +<?import javafx.scene.control.ToggleButton?> <?import javafx.scene.control.ToggleGroup?> <?import javafx.scene.layout.AnchorPane?> <?import javafx.scene.layout.HBox?> @@ -14,15 +16,33 @@ <VBox fx:id="parent" alignment="CENTER" prefHeight="400.0" prefWidth="600.0" spacing="20.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hdm_stuttgart.battlearena.Controller.LocalCreateController"> <children> + <Pane VBox.vgrow="ALWAYS" /> <HBox alignment="TOP_CENTER" spacing="20.0"> <children> <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Rounds:" /> <Accordion> <panes> - <TitledPane animated="false" text="untitled 1"> - <content> - <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" /> - </content> + <TitledPane fx:id="roundsTitledPane" text="Select"> + <content> + <ScrollPane minViewportHeight="40.0"> + <content> + <VBox fx:id="boxBox"> + <children> + <ToggleButton mnemonicParsing="false" styleClass="roundsButton" text="1"> + <toggleGroup> + <ToggleGroup fx:id="rounds" /> + </toggleGroup> + <VBox.margin> + <Insets /> + </VBox.margin> + </ToggleButton> + <ToggleButton mnemonicParsing="false" styleClass="roundsButton" text="2" toggleGroup="$rounds" /> + <ToggleButton mnemonicParsing="false" styleClass="roundsButton" text="3" toggleGroup="$rounds" /> + </children> + </VBox> + </content> + </ScrollPane> + </content> </TitledPane> </panes> </Accordion> @@ -36,7 +56,7 @@ <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Time:" /> <Accordion> <panes> - <TitledPane animated="false" text="untitled 1"> + <TitledPane animated="false" text="Select"> <content> <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" /> </content> @@ -47,7 +67,7 @@ </HBox> <HBox alignment="TOP_CENTER" spacing="10.0"> <children> - <Text strokeType="OUTSIDE" strokeWidth="0.0" text="PLayers:" /> + <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Players:" /> <RadioButton mnemonicParsing="false" selected="true" text="2"> <toggleGroup> <ToggleGroup fx:id="group31" /> @@ -91,12 +111,11 @@ </children> </HBox> <Button mnemonicParsing="false" onAction="#skinSelectionScene" text="Start" /> - <Button mnemonicParsing="false" onAction="#playScene" text="Back"> + <Button mnemonicParsing="false" onAction="#backButton" text="Back"> <VBox.margin> <Insets bottom="50.0" /> </VBox.margin> </Button> <Pane VBox.vgrow="ALWAYS" /> - <Pane VBox.vgrow="ALWAYS" /> </children> </VBox> diff --git a/src/main/resources/fxml/MainMenu.fxml b/src/main/resources/fxml/MainMenu.fxml index 385eeb92c0ed4cce0d84e17363a2007d4a6c648b..39b45c2b7b94147fc779dda696f89e11fafa9e44 100644 --- a/src/main/resources/fxml/MainMenu.fxml +++ b/src/main/resources/fxml/MainMenu.fxml @@ -15,9 +15,9 @@ <Insets top="20.0" /> </VBox.margin> </Button> - <Button mnemonicParsing="false" text="Map Creator" VBox.vgrow="ALWAYS" /> + <Button mnemonicParsing="false" onAction="#mapScene" text="Map Forge" VBox.vgrow="ALWAYS" /> <Button mnemonicParsing="false" onAction="#statisticsScene" text="Statistics" VBox.vgrow="ALWAYS" /> - <Button mnemonicParsing="false" onAction="#optionsScene" text="Options" /> + <Button mnemonicParsing="false" onAction="#settingsScene" text="Settings" /> <Button fx:id="exitButton" alignment="CENTER" mnemonicParsing="false" onAction="#exit" text="Exit" /> <Pane VBox.vgrow="ALWAYS" /> <Pane layoutX="10.0" layoutY="395.0" VBox.vgrow="ALWAYS" /> diff --git a/src/main/resources/fxml/MapForge.fxml b/src/main/resources/fxml/MapForge.fxml new file mode 100644 index 0000000000000000000000000000000000000000..3c5265a067cce738ee950498e6b592adee6cb6d8 --- /dev/null +++ b/src/main/resources/fxml/MapForge.fxml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import javafx.scene.control.Button?> +<?import javafx.scene.layout.Pane?> +<?import javafx.scene.layout.VBox?> + +<VBox fx:id="parent" alignment="CENTER" prefHeight="400.0" prefWidth="600.0" spacing="50.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hdm_stuttgart.battlearena.Controller.MapForgeController"> + <children> + <Pane VBox.vgrow="ALWAYS" /> + <Button mnemonicParsing="false" onAction="#mapEditorScene" text="Map Editor" /> + <Button mnemonicParsing="false" onAction="#communityMapScene" text="Community Maps" /> + <Button mnemonicParsing="false" onAction="#updateMapScene" text="Update Core Maps" /> + <Button mnemonicParsing="false" onAction="#backButton" text="Back" /> + <Pane VBox.vgrow="ALWAYS" /> + <Pane VBox.vgrow="ALWAYS" /> + </children> +</VBox> diff --git a/src/main/resources/fxml/MenuBorderPane.fxml b/src/main/resources/fxml/MenuBorderPane.fxml index 3d57e01ff6b3502f741c6c780cf56e6c04bf6419..ed87f4119563968953eef9ff3013783e8ce18a5e 100644 --- a/src/main/resources/fxml/MenuBorderPane.fxml +++ b/src/main/resources/fxml/MenuBorderPane.fxml @@ -4,10 +4,12 @@ <?import javafx.scene.image.Image?> <?import javafx.scene.image.ImageView?> <?import javafx.scene.layout.BorderPane?> +<?import javafx.scene.layout.StackPane?> +<?import javafx.scene.text.Font?> <BorderPane id="mainMenu" fx:id="parent" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hdm_stuttgart.battlearena.Controller.MenuBorderPaneController"> <right> - <Button fx:id="btnRight" mnemonicParsing="false" onAction="#easterEgg" prefWidth="111.0" BorderPane.alignment="BOTTOM_CENTER"> + <Button fx:id="btnRight" mnemonicParsing="false" prefWidth="111.0" BorderPane.alignment="BOTTOM_CENTER"> <graphic> <ImageView fx:id="imgRight" fitHeight="845.0" fitWidth="799.0" pickOnBounds="true" preserveRatio="true"> <image> @@ -18,7 +20,7 @@ </Button> </right> <left> - <Button mnemonicParsing="false" BorderPane.alignment="BOTTOM_CENTER"> + <Button fx:id="btnLeft" contentDisplay="TOP" mnemonicParsing="false" text=":)" BorderPane.alignment="BOTTOM_CENTER"> <graphic> <ImageView fx:id="imgLeft" fitHeight="904.0" fitWidth="856.0" pickOnBounds="true" preserveRatio="true"> <image> @@ -26,6 +28,12 @@ </image> </ImageView> </graphic> + <font> + <Font name="System Bold" size="30.0" /> + </font> </Button> </left> + <center> + <StackPane fx:id="center" BorderPane.alignment="CENTER" /> + </center> </BorderPane> diff --git a/src/main/resources/fxml/Multiplayer.fxml b/src/main/resources/fxml/Multiplayer.fxml index 690769c28f168b253fbfe41f6e5e559e0decc270..6746b48025b1335c72d967e59be21c3a22fd70fb 100644 --- a/src/main/resources/fxml/Multiplayer.fxml +++ b/src/main/resources/fxml/Multiplayer.fxml @@ -5,10 +5,9 @@ <?import javafx.scene.layout.Pane?> <?import javafx.scene.layout.VBox?> - <VBox fx:id="parent" alignment="CENTER" prefHeight="400.0" prefWidth="600.0" spacing="50.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hdm_stuttgart.battlearena.Controller.MultiplayerController"> <children> - <Pane maxHeight="1.7976931348623157E308" prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS" /> + <Pane VBox.vgrow="ALWAYS" /> <Button mnemonicParsing="false" onAction="#multiplayerCreateScene" text="Create" VBox.vgrow="ALWAYS"> <VBox.margin> <Insets top="20.0" /> @@ -16,10 +15,10 @@ </Button> <Button mnemonicParsing="false" onAction="#multiplayerJoinScene" text="Join" VBox.vgrow="ALWAYS"> <VBox.margin> - <Insets bottom="50.0" /> + <Insets /> </VBox.margin> </Button> - <Button alignment="CENTER" mnemonicParsing="false" onAction="#playScene" text="Back"> + <Button alignment="CENTER" mnemonicParsing="false" onAction="#backButton" text="Back"> <VBox.margin> <Insets /> </VBox.margin> diff --git a/src/main/resources/fxml/MultiplayerCreate.fxml b/src/main/resources/fxml/MultiplayerCreate.fxml index b0909c0079e798d74543c95dfcb6c6f19d6cf72e..3cf21a91e290fca2da1b2516320c1feb50a99cee 100644 --- a/src/main/resources/fxml/MultiplayerCreate.fxml +++ b/src/main/resources/fxml/MultiplayerCreate.fxml @@ -10,7 +10,6 @@ <?import javafx.scene.layout.VBox?> <?import javafx.scene.text.Text?> - <VBox fx:id="parent" alignment="CENTER" prefHeight="400.0" prefWidth="600.0" spacing="20.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hdm_stuttgart.battlearena.Controller.MultiplayerCreateController"> <children> <Pane VBox.vgrow="ALWAYS" /> @@ -49,7 +48,7 @@ </VBox.margin> </AnchorPane> <Button mnemonicParsing="false" text="Start" /> - <Button mnemonicParsing="false" onAction="#multiplayerScene" text="Back" /> + <Button mnemonicParsing="false" onAction="#backButton" text="Back" /> <Pane VBox.vgrow="ALWAYS" /> <Pane VBox.vgrow="ALWAYS" /> </children> diff --git a/src/main/resources/fxml/MultiplayerJoin.fxml b/src/main/resources/fxml/MultiplayerJoin.fxml index e8a48e621d53819dee9b9bf53b9440b4bbd1bb9a..117cf38cd7ba79fb3f41209f4a4b869e4a11e889 100644 --- a/src/main/resources/fxml/MultiplayerJoin.fxml +++ b/src/main/resources/fxml/MultiplayerJoin.fxml @@ -6,7 +6,6 @@ <?import javafx.scene.layout.VBox?> <?import javafx.scene.text.Text?> - <VBox fx:id="parent" alignment="CENTER" prefHeight="400.0" prefWidth="600.0" spacing="50.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hdm_stuttgart.battlearena.Controller.MultiplayerJoinController"> <children> <Pane maxHeight="1.7976931348623157E308" prefHeight="200.0" prefWidth="200.0" /> @@ -15,7 +14,7 @@ <Button mnemonicParsing="false" text="Connect" VBox.vgrow="ALWAYS" /> <Text strokeType="OUTSIDE" strokeWidth="0.0" text="[Error Message]" /> <Pane maxHeight="1.7976931348623157E308" prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS" /> - <Button alignment="CENTER" mnemonicParsing="false" onAction="#multiplayerScene" text="Back" /> + <Button alignment="CENTER" mnemonicParsing="false" onAction="#backButton" text="Back" /> <Pane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="20.0" VBox.vgrow="ALWAYS" /> </children> </VBox> diff --git a/src/main/resources/fxml/Options.fxml b/src/main/resources/fxml/Options.fxml deleted file mode 100644 index 79f14cd61fc942bff138bc3a22443bdf8f9ef2a0..0000000000000000000000000000000000000000 --- a/src/main/resources/fxml/Options.fxml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<?import javafx.scene.control.Button?> -<?import javafx.scene.control.Slider?> -<?import javafx.scene.layout.HBox?> -<?import javafx.scene.layout.VBox?> -<?import javafx.scene.text.Text?> - - -<VBox fx:id="parent" alignment="CENTER" prefHeight="400.0" prefWidth="600.0" spacing="20.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hdm_stuttgart.battlearena.Controller.OptionsController"> - <children> - <HBox alignment="CENTER"> - <children> - <VBox alignment="TOP_CENTER" spacing="10.0"> - <children> - <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Volume:" /> - <Slider fx:id="volumeSlider" blockIncrement="25.0" majorTickUnit="100.0" minorTickCount="1" prefHeight="14.0" prefWidth="480.0" showTickLabels="true" value="75.0" VBox.vgrow="NEVER" /> - </children> - </VBox> - </children> - </HBox> - <Button mnemonicParsing="false" onAction="#creditScene" text="Credits" /> - <Button mnemonicParsing="false" onAction="#mainMenuScene" text="Back" /> - </children> -</VBox> diff --git a/src/main/resources/fxml/Play.fxml b/src/main/resources/fxml/Play.fxml index 1cdd69e375cc8a700854d3e66b5caa1a8b9d6ad7..a4cbce23e49949a94521f25dd1b898423ae67e2a 100644 --- a/src/main/resources/fxml/Play.fxml +++ b/src/main/resources/fxml/Play.fxml @@ -4,13 +4,12 @@ <?import javafx.scene.layout.Pane?> <?import javafx.scene.layout.VBox?> - <VBox fx:id="parent" alignment="CENTER" prefHeight="400.0" prefWidth="600.0" spacing="20.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hdm_stuttgart.battlearena.Controller.PlayController"> <children> <Pane VBox.vgrow="ALWAYS" /> <Button mnemonicParsing="false" onAction="#localScene" text="Local" /> <Button mnemonicParsing="false" onAction="#multiplayerScene" text="Multiplayer" /> - <Button alignment="CENTER" mnemonicParsing="false" onAction="#mainMenuScene" text="Back" /> + <Button alignment="CENTER" mnemonicParsing="false" onAction="#backButton" text="Back" /> <Pane VBox.vgrow="ALWAYS" /> <Pane VBox.vgrow="ALWAYS" /> </children> diff --git a/src/main/resources/fxml/PlayerCreateScene.fxml b/src/main/resources/fxml/PlayerCreateScene.fxml new file mode 100644 index 0000000000000000000000000000000000000000..1563facf396815b701f237fdab3dd7e3769c7951 --- /dev/null +++ b/src/main/resources/fxml/PlayerCreateScene.fxml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import javafx.scene.control.Button?> +<?import javafx.scene.layout.BorderPane?> +<?import javafx.scene.layout.StackPane?> +<?import javafx.scene.layout.VBox?> +<?import javafx.scene.media.MediaView?> +<?import javafx.scene.text.Text?> + + +<BorderPane fx:id="parent" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hdm_stuttgart.battlearena.Controller.PlayerCreateController"> + <center> + <StackPane BorderPane.alignment="CENTER"> + <children> + <MediaView fx:id="mediaView" fitHeight="200.0" fitWidth="200.0" /> + <VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" spacing="10.0"> + <children> + <Text fill="WHITE" strokeType="OUTSIDE" strokeWidth="0.0" text="WELCOME!" /> + <Text fill="WHITE" strokeType="OUTSIDE" strokeWidth="0.0" text="This page is still under construction" /> + <Text fill="WHITE" strokeType="OUTSIDE" strokeWidth="0.0" text="please have some patience" /> + <Text fill="WHITE" strokeType="OUTSIDE" strokeWidth="0.0" text="Thank you" /> + <Button fx:id="button" mnemonicParsing="false" text="Get me out of here" /> + </children> + </VBox> + </children> + </StackPane> + </center> +</BorderPane> diff --git a/src/main/resources/fxml/Settings.fxml b/src/main/resources/fxml/Settings.fxml new file mode 100644 index 0000000000000000000000000000000000000000..6cab6585ef8f19e015fc3645684934a599ee9aec --- /dev/null +++ b/src/main/resources/fxml/Settings.fxml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import javafx.scene.control.Button?> +<?import javafx.scene.control.Slider?> +<?import javafx.scene.layout.HBox?> +<?import javafx.scene.layout.VBox?> +<?import javafx.scene.text.Text?> + +<VBox fx:id="parent" alignment="CENTER" prefHeight="400.0" prefWidth="600.0" spacing="20.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hdm_stuttgart.battlearena.Controller.SettingsController"> + <children> + <HBox alignment="CENTER"> + <children> + <VBox alignment="TOP_CENTER" spacing="10.0"> + <children> + <VBox alignment="CENTER" VBox.vgrow="ALWAYS"> + <children> + <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Music volume:" /> + <Slider fx:id="musicVolume" blockIncrement="25.0" majorTickUnit="100.0" minorTickCount="1" prefHeight="14.0" prefWidth="480.0" showTickLabels="true" value="75.0" VBox.vgrow="NEVER" /> + </children> + </VBox> + <VBox alignment="CENTER" VBox.vgrow="ALWAYS"> + <children> + <Text strokeType="OUTSIDE" strokeWidth="0.0" text="SFX volume:" /> + <Slider fx:id="sfxVolume" blockIncrement="25.0" majorTickUnit="100.0" minorTickCount="1" prefHeight="14.0" prefWidth="480.0" showTickLabels="true" value="75.0" /> + </children> + </VBox> + </children> + </VBox> + </children> + </HBox> + <Button mnemonicParsing="false" onAction="#creditScene" text="Credits" /> + <Button mnemonicParsing="false" onAction="#backButton" text="Back" /> + </children> +</VBox> diff --git a/src/main/resources/fxml/SkinSelection.fxml b/src/main/resources/fxml/SkinSelection.fxml index 97773771860f208bdfa49f51c5219c0e89e16ef3..b98b91af38434be6169c8cdfead739ef20587460 100644 --- a/src/main/resources/fxml/SkinSelection.fxml +++ b/src/main/resources/fxml/SkinSelection.fxml @@ -12,9 +12,9 @@ <children> <HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" spacing="40.0"> <children> - <ToggleButton contentDisplay="TOP" mnemonicParsing="false" text="Elias"> + <ToggleButton contentDisplay="TOP" mnemonicParsing="false" styleClass="skinSelection" text="Elias"> <graphic> - <ImageView fitHeight="700.0" fitWidth="700.0" pickOnBounds="true" preserveRatio="true"> + <ImageView fx:id="selection1" fitHeight="700.0" fitWidth="700.0" pickOnBounds="true" preserveRatio="true"> <image> <Image url="@../textures/images/elias.png" /> </image> @@ -24,18 +24,18 @@ <ToggleGroup fx:id="selectionButton" /> </toggleGroup> </ToggleButton> - <ToggleButton contentDisplay="TOP" mnemonicParsing="false" text="Erzan" toggleGroup="$selectionButton"> + <ToggleButton contentDisplay="TOP" mnemonicParsing="false" styleClass="skinSelection" text="Erzan" toggleGroup="$selectionButton"> <graphic> - <ImageView fitHeight="700.0" fitWidth="700.0" pickOnBounds="true" preserveRatio="true"> + <ImageView fx:id="selection2" fitHeight="700.0" fitWidth="700.0" pickOnBounds="true" preserveRatio="true"> <image> <Image url="@../textures/images/erzan.png" /> </image> </ImageView> </graphic> </ToggleButton> - <ToggleButton contentDisplay="TOP" mnemonicParsing="false" text="Martin" toggleGroup="$selectionButton"> + <ToggleButton contentDisplay="TOP" mnemonicParsing="false" styleClass="skinSelection" text="Martin" toggleGroup="$selectionButton"> <graphic> - <ImageView fitHeight="700.0" fitWidth="700.0" pickOnBounds="true" preserveRatio="true"> + <ImageView fx:id="selection3" fitHeight="700.0" fitWidth="700.0" pickOnBounds="true" preserveRatio="true"> <image> <Image url="@../textures/images/martin.png" /> </image> @@ -45,6 +45,6 @@ </children> </HBox> <Button mnemonicParsing="false" onAction="#gameScene" text="Start" /> - <Button mnemonicParsing="false" onAction="#back" text="Back" /> + <Button mnemonicParsing="false" onAction="#backButton" text="Back" /> </children> </VBox> diff --git a/src/main/resources/fxml/Statistics.fxml b/src/main/resources/fxml/Statistics.fxml index cb429d7b51d3d377a00e0495feee430c61cd7998..6c98b4e5e5aa7e8efd880b6945b8c7091aa04d32 100644 --- a/src/main/resources/fxml/Statistics.fxml +++ b/src/main/resources/fxml/Statistics.fxml @@ -7,10 +7,9 @@ <?import javafx.scene.layout.VBox?> <?import javafx.scene.text.Text?> - <VBox fx:id="parent" alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" spacing="50.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hdm_stuttgart.battlearena.Controller.StatisticsController"> <children> - <HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" spacing="30.0"> + <HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" spacing="30.0" VBox.vgrow="ALWAYS"> <children> <VBox alignment="CENTER_RIGHT" prefHeight="200.0" prefWidth="100.0" spacing="10.0" HBox.hgrow="ALWAYS"> <children> @@ -35,10 +34,16 @@ <Insets /> </HBox.margin> </VBox> - <VBox prefHeight="200.0" prefWidth="100.0"> + <VBox prefHeight="200.0" prefWidth="100.0" HBox.hgrow="ALWAYS"> <children> - <PieChart fx:id="kd" /> - <PieChart fx:id="wl" /> + <PieChart fx:id="kd" minHeight="-Infinity" minWidth="-Infinity" VBox.vgrow="ALWAYS"> + <VBox.margin> + <Insets bottom="-200.0" /> + </VBox.margin></PieChart> + <PieChart fx:id="wl" minHeight="-Infinity" minWidth="-Infinity" VBox.vgrow="ALWAYS"> + <VBox.margin> + <Insets top="-40.0" /> + </VBox.margin></PieChart> </children> </VBox> </children> diff --git a/src/main/resources/sound/music/cocBackgroundMusicTest.mp3 b/src/main/resources/sound/music/cocBackgroundMusicTest.mp3 index e916ecb6c0b6487e9bcb8ca6c3d54f6259eac9dc..fe39b45659600de8eb2ed2bdac281444be461261 100644 Binary files a/src/main/resources/sound/music/cocBackgroundMusicTest.mp3 and b/src/main/resources/sound/music/cocBackgroundMusicTest.mp3 differ diff --git a/src/main/resources/sound/music/constructionJazz.mp3 b/src/main/resources/sound/music/constructionJazz.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..5669e8017883014e447765a405c6ec3b208db5bb Binary files /dev/null and b/src/main/resources/sound/music/constructionJazz.mp3 differ diff --git a/src/main/resources/styles/style.css b/src/main/resources/styles/style.css index bb2a6b5c6f0ed83f68a407a24e34124a8caec3fe..2bb5cd89b79625f3392d4701dcf93ac9fb88d7f2 100644 --- a/src/main/resources/styles/style.css +++ b/src/main/resources/styles/style.css @@ -3,10 +3,13 @@ -fx-brown: #956233; } +#button { + -fx-text-fill: black; +} + .root { -fx-font-family: "Starship Shadow"; - -fx-text-fill: -fx-brown; - -fx-font-size: 50; + -fx-text-fill: white; -fx-background-color: black; } @@ -22,13 +25,75 @@ .button { -fx-text-fill: -fx-brown; -fx-background-color: none; - -fx-skin: "de.hdm_stuttgart.battlearena.Controller.ButtonTransition"; + -fx-skin: "de.hdm_stuttgart.battlearena.Controller.Utilities.ButtonTransition"; +} + +#btnLeft { + -fx-skin: none; + -fx-text-fill: white; } .accordion { -fx-font-size: 30; } +.titled-pane:focused > .title > .arrow-button > .arrow { + -fx-effect: null; +} + +.accordion .titled-pane > *.content{ + -fx-background-color: transparent ; + -fx-border-width: 0; +} + +.accordion .titled-pane > .title { + -fx-background-color: transparent; + -fx-border-width: 0; +} + +.scroll-pane > .viewport { + -fx-background-color: none; +} + +.scroll-pane { + -fx-background-color: transparent; +} + +/*scroll pane scroll bar*/ +.scroll-pane .scroll-bar:horizontal .track, +.scroll-pane .scroll-bar:vertical .track { + -fx-background-color: -fx-dark-brown; + -fx-border-color: none; + -fx-background-radius: 1em; + -fx-border-radius: 1em; +} + +/* The increment and decrement button CSS class of scrollbar */ +.scroll-pane .scroll-bar:vertical .increment-button , +.scroll-pane .scroll-bar:vertical .decrement-button { + -fx-background-color: transparent; + -fx-background-radius: 0em; + -fx-padding:0 12 0 0; +} + +.scroll-pane .scroll-bar .increment-arrow, +.scroll-pane .scroll-bar .decrement-arrow { + -fx-shape: " "; + -fx-padding: 0; +} + +/* The main scrollbar **thumb** CSS class which we drag every time (movable) */ +.scroll-pane .scroll-bar:horizontal .thumb, +.scroll-pane .scroll-bar:vertical .thumb { + -fx-background-color: white; + -fx-background-insets: 2, 0, 0; + -fx-background-radius: 1em; +} + +#boxBox { + -fx-background-color: none; +} + /* https://dx.dragan.ba/javafx-radiobutton-custom-css/ */ .radio-button .radio { -fx-border-width: 1px; @@ -49,7 +114,7 @@ } .slider .track { - -fx-background-color: rgba(0, 0, 0, 0.5); + -fx-background-color: rgba(0, 0, 0, 0.5); -fx-pref-height: 0.2em; } @@ -60,6 +125,60 @@ } .toggle-button { - -fx-skin: "de.hdm_stuttgart.battlearena.Controller.ToggleButtonTransition"; + -fx-skin: "de.hdm_stuttgart.battlearena.Controller.Utilities.ToggleButtonTransition"; -fx-background-color: none; } + +.skinSelection:pressed { + -fx-background-color: rgba(255, 255, 255, 0.3); +} + +.table-view { + -fx-background-color: transparent; +} + +.table-view .column-header { + -fx-background-color: -fx-brown; +} + +.table-view .table-cell{ + -fx-font-size: 30; + -fx-alignment: center; +} + +.table-row-cell { + -fx-background-color: rgba(0, 0, 0, 0.2); +} + +.table-row-cell:hover { + -fx-background-color: rgba(0, 0, 0, 0.1); +} + +.table-row-cell:selected { + -fx-background-color: rgba(255, 255, 255, 0.3); +} + +.chart { + -fx-pref-width: 600; + -fx-pref-height: 620; + -fx-min-width: 600; + -fx-min-height: 620; + -fx-max-width: 916; + -fx-max-height: 620; +} + +.chart-pie { + -fx-border-color: black; +} + +.chart-pie-label { + -fx-font-size: 0.7em; +} + +.chart-legend { + -fx-background-color: rgba(60, 32, 20, 0.2); +} + +.default-color0.chart-pie {-fx-pie-color: transparent;} +.default-color1.chart-pie {-fx-pie-color: transparent;} +.default-color2.chart-pie {-fx-pie-color: transparent;} diff --git a/src/main/resources/textures/images/background.png b/src/main/resources/textures/images/background.png index 67ec5faee876e21cc496b5a4a265deed0a14a7cf..cfecaea36ac9953b10720b8cee301e0501b75064 100644 Binary files a/src/main/resources/textures/images/background.png and b/src/main/resources/textures/images/background.png differ diff --git a/src/main/resources/textures/images/icon.png b/src/main/resources/textures/images/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ec952db144b1681f2e7ce5954f1ffaeda29fab71 Binary files /dev/null and b/src/main/resources/textures/images/icon.png differ diff --git a/src/main/resources/videos/=D.mp4 b/src/main/resources/videos/=D.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..a83c91d46b68617ecf3c40b8f91ab67f930e53b6 Binary files /dev/null and b/src/main/resources/videos/=D.mp4 differ diff --git a/src/main/resources/videos/allMyFellas.mp4 b/src/main/resources/videos/allMyFellas.mp4 index 4234d4da1c07a7e775bced2e4e44c2329c8be972..5371bd89089430d7fa4e467da0e857743a9cdd0b 100644 Binary files a/src/main/resources/videos/allMyFellas.mp4 and b/src/main/resources/videos/allMyFellas.mp4 differ diff --git a/src/main/resources/videos/async.mp4 b/src/main/resources/videos/async.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..4fef92ce7683b37e7e5dd01c5d6561fdaef4310c Binary files /dev/null and b/src/main/resources/videos/async.mp4 differ diff --git a/src/main/resources/videos/banana.mp4 b/src/main/resources/videos/banana.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..389d4987f86aa037d333fc7f2c84ecf9d1bc02f8 Binary files /dev/null and b/src/main/resources/videos/banana.mp4 differ diff --git a/src/main/resources/videos/basketball.mp4 b/src/main/resources/videos/basketball.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..067fcfbcc003a71f39c03b43e1882ceda9e9869c Binary files /dev/null and b/src/main/resources/videos/basketball.mp4 differ diff --git a/src/main/resources/videos/bear.mp4 b/src/main/resources/videos/bear.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..a74b90e33e6a40e197818a80d149c4626a3bed7d Binary files /dev/null and b/src/main/resources/videos/bear.mp4 differ diff --git a/src/main/resources/videos/carl.mp4 b/src/main/resources/videos/carl.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..54685a745086afb498765ff1e681655871e0225e Binary files /dev/null and b/src/main/resources/videos/carl.mp4 differ diff --git a/src/main/resources/videos/cat.mp4 b/src/main/resources/videos/cat.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..f9c8f30586069bb8c693e3278a33c7e0e0c274ce Binary files /dev/null and b/src/main/resources/videos/cat.mp4 differ diff --git a/src/main/resources/videos/catEating.mp4 b/src/main/resources/videos/catEating.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..530059520bc6a7ec848fca40e27371fac757171a Binary files /dev/null and b/src/main/resources/videos/catEating.mp4 differ diff --git a/src/main/resources/videos/catSitting.mp4 b/src/main/resources/videos/catSitting.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..28007e146999a02253044e4423819e80ec590c22 Binary files /dev/null and b/src/main/resources/videos/catSitting.mp4 differ diff --git a/src/main/resources/videos/chaCha.mp4 b/src/main/resources/videos/chaCha.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..700b233f8ce39926076fd7870bd6920d603c8d23 Binary files /dev/null and b/src/main/resources/videos/chaCha.mp4 differ diff --git a/src/main/resources/videos/cheezburger.mp4 b/src/main/resources/videos/cheezburger.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..4910d355b7ef46d080954028c2c9376ba7993a92 Binary files /dev/null and b/src/main/resources/videos/cheezburger.mp4 differ diff --git a/src/main/resources/videos/construction.mp4 b/src/main/resources/videos/construction.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..0d313d3f92093732300fcfe69d27f6583c66cb99 Binary files /dev/null and b/src/main/resources/videos/construction.mp4 differ diff --git a/src/main/resources/videos/credits.mp4 b/src/main/resources/videos/credits.mp4 index 310acc2c75039d7bdad7f3d642e2d0e828573811..410d261aba44faf7e6f2ba606393f76ba1ba526f 100644 Binary files a/src/main/resources/videos/credits.mp4 and b/src/main/resources/videos/credits.mp4 differ diff --git a/src/main/resources/videos/depression.mp4 b/src/main/resources/videos/depression.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..9e282df3676adcb28bc15d9238025fe6b37d9fcb Binary files /dev/null and b/src/main/resources/videos/depression.mp4 differ diff --git a/src/main/resources/videos/dog.mp4 b/src/main/resources/videos/dog.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..2f291192b17204d93730dede0be6a24f1fa26066 Binary files /dev/null and b/src/main/resources/videos/dog.mp4 differ diff --git a/src/main/resources/videos/dog2.mp4 b/src/main/resources/videos/dog2.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..4500f7ae5c2e9d8d1ba8a06fdfb60a0cc47f2d7b Binary files /dev/null and b/src/main/resources/videos/dog2.mp4 differ diff --git a/src/main/resources/videos/dogCheese.mp4 b/src/main/resources/videos/dogCheese.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..eb24b7b5f7b5d2eb6a72dcb0b3ac1d3281cd789b Binary files /dev/null and b/src/main/resources/videos/dogCheese.mp4 differ diff --git a/src/main/resources/videos/firework.mp4 b/src/main/resources/videos/firework.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..706941c2cde672b81881056aa759308d67f433c0 Binary files /dev/null and b/src/main/resources/videos/firework.mp4 differ diff --git a/src/main/resources/videos/frog.mp4 b/src/main/resources/videos/frog.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..e411b29309d38ffa3421e36ed3e9a3f4e9f9ad39 Binary files /dev/null and b/src/main/resources/videos/frog.mp4 differ diff --git a/src/main/resources/videos/gameboy.mp4 b/src/main/resources/videos/gameboy.mp4 index 91a1eaa78366adbb3686a07594417fd9c8832126..68821d3565f0efcc9995b2f7afaa220b9ca786eb 100644 Binary files a/src/main/resources/videos/gameboy.mp4 and b/src/main/resources/videos/gameboy.mp4 differ diff --git a/src/main/resources/videos/gamecube.mp4 b/src/main/resources/videos/gamecube.mp4 index 135416e7b63fc25ed1e3e2b744c6d14a78692b99..a60bade2b34051ffd295a22de564a6476adbe8fc 100644 Binary files a/src/main/resources/videos/gamecube.mp4 and b/src/main/resources/videos/gamecube.mp4 differ diff --git a/src/main/resources/videos/gta.mp4 b/src/main/resources/videos/gta.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..0259ca609572a35adb34f9c7293d49c9e97e37b8 Binary files /dev/null and b/src/main/resources/videos/gta.mp4 differ diff --git a/src/main/resources/videos/gtfo.mp4 b/src/main/resources/videos/gtfo.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..536961ae8a9414f7b16ac646d4ceb0844d13a23f Binary files /dev/null and b/src/main/resources/videos/gtfo.mp4 differ diff --git a/src/main/resources/videos/holyCrap.mp4 b/src/main/resources/videos/holyCrap.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..1f294f38de16731b5f4f5261ebebd0b2356380f3 Binary files /dev/null and b/src/main/resources/videos/holyCrap.mp4 differ diff --git a/src/main/resources/videos/horse.mp4 b/src/main/resources/videos/horse.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..d4f6f7429a9f49344bf63f6602ac35131338b2a0 Binary files /dev/null and b/src/main/resources/videos/horse.mp4 differ diff --git a/src/main/resources/videos/imNotYou.mp4 b/src/main/resources/videos/imNotYou.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..ade7b0800c3a53b242182a065022a91475ac367e Binary files /dev/null and b/src/main/resources/videos/imNotYou.mp4 differ diff --git a/src/main/resources/videos/kangaroo.mp4 b/src/main/resources/videos/kangaroo.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..3cff449b6180fcbdbe367da02416525331ae94af Binary files /dev/null and b/src/main/resources/videos/kangaroo.mp4 differ diff --git a/src/main/resources/videos/legCat.mp4 b/src/main/resources/videos/legCat.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..82644243c6fd83c051092f40337df516edf8f6d0 Binary files /dev/null and b/src/main/resources/videos/legCat.mp4 differ diff --git a/src/main/resources/videos/lessGoo.mp4 b/src/main/resources/videos/lessGoo.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..a90f7c54729bcd5c78ad95f490520d97fab10920 Binary files /dev/null and b/src/main/resources/videos/lessGoo.mp4 differ diff --git a/src/main/resources/videos/lifeCouldBeMonke.mp4 b/src/main/resources/videos/lifeCouldBeMonke.mp4 index 67a0106470b6e00d968f9930b5081d517545b3e4..13f8bf59c6c1d068156d65e04cdacf19070066c9 100644 Binary files a/src/main/resources/videos/lifeCouldBeMonke.mp4 and b/src/main/resources/videos/lifeCouldBeMonke.mp4 differ diff --git a/src/main/resources/videos/minecraftCat.mp4 b/src/main/resources/videos/minecraftCat.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..27e80735688963c86e27d81c6da25200da5854aa Binary files /dev/null and b/src/main/resources/videos/minecraftCat.mp4 differ diff --git a/src/main/resources/videos/minecraftCat2.mp4 b/src/main/resources/videos/minecraftCat2.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..1e9366af84a9aa9f363655de9b313cab98e77fba Binary files /dev/null and b/src/main/resources/videos/minecraftCat2.mp4 differ diff --git a/src/main/resources/videos/monke.mp4 b/src/main/resources/videos/monke.mp4 index c6d5f3c2e7f390276d22b26e46f462bb1e281d98..980756e7cd8fa4c3c00d5a246ad179b143c1fae1 100644 Binary files a/src/main/resources/videos/monke.mp4 and b/src/main/resources/videos/monke.mp4 differ diff --git a/src/main/resources/videos/msPuff.mp4 b/src/main/resources/videos/msPuff.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..42c91ab4bc895be00b0704f7eb73cded4c896d4f Binary files /dev/null and b/src/main/resources/videos/msPuff.mp4 differ diff --git a/src/main/resources/videos/muecke.mp4 b/src/main/resources/videos/muecke.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..c146f51e85f55df05f872781e4cfb09d5b222b87 Binary files /dev/null and b/src/main/resources/videos/muecke.mp4 differ diff --git a/src/main/resources/videos/myMind.mp4 b/src/main/resources/videos/myMind.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..e4616242924e020b3f536320e51a434aad0cdc69 Binary files /dev/null and b/src/main/resources/videos/myMind.mp4 differ diff --git a/src/main/resources/videos/pablo.mp4 b/src/main/resources/videos/pablo.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..b5d84444d5036bbb1c99cea570fb8a75e078c6f3 Binary files /dev/null and b/src/main/resources/videos/pablo.mp4 differ diff --git a/src/main/resources/videos/pancake.mp4 b/src/main/resources/videos/pancake.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..5bda0b20ea3bd71adbfa4d47ed90dfaf88dad5e1 Binary files /dev/null and b/src/main/resources/videos/pancake.mp4 differ diff --git a/src/main/resources/videos/parkingTickets.mp4 b/src/main/resources/videos/parkingTickets.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..cfebfc02ba32074f6415fe842956776a5cf09f3e Binary files /dev/null and b/src/main/resources/videos/parkingTickets.mp4 differ diff --git a/src/main/resources/videos/pot.mp4 b/src/main/resources/videos/pot.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..1aa9d7a0ce192a769e5096bcaf549234778a84c5 Binary files /dev/null and b/src/main/resources/videos/pot.mp4 differ diff --git a/src/main/resources/videos/rejectHumanity.mp4 b/src/main/resources/videos/rejectHumanity.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..6c2a377ca00e8f9381095c76661e5de75902b4f0 Binary files /dev/null and b/src/main/resources/videos/rejectHumanity.mp4 differ diff --git a/src/main/resources/videos/roomba.mp4 b/src/main/resources/videos/roomba.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..65a1e5aebe700b1b720182bf9ceaff3e6e160f88 Binary files /dev/null and b/src/main/resources/videos/roomba.mp4 differ diff --git a/src/main/resources/videos/sad.mp4 b/src/main/resources/videos/sad.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..9eb120c9e461edaed7858c02a42d44dc25f49e31 Binary files /dev/null and b/src/main/resources/videos/sad.mp4 differ diff --git a/src/main/resources/videos/sadCat.mp4 b/src/main/resources/videos/sadCat.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..6daceb2c5e67a7b328aa541cb4f076249ce1fdf5 Binary files /dev/null and b/src/main/resources/videos/sadCat.mp4 differ diff --git a/src/main/resources/videos/sadHorse.mp4 b/src/main/resources/videos/sadHorse.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..dc6901a500652632c29c51d500b369044118ee58 Binary files /dev/null and b/src/main/resources/videos/sadHorse.mp4 differ diff --git a/src/main/resources/videos/seal.mp4 b/src/main/resources/videos/seal.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..5f5f39382d212d1b1cf15a9eaf44fb90ee06e4f9 Binary files /dev/null and b/src/main/resources/videos/seal.mp4 differ diff --git a/src/main/resources/videos/slippery.mp4 b/src/main/resources/videos/slippery.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..b26ecb1ceda0d65050f5244c98e76af43c717558 Binary files /dev/null and b/src/main/resources/videos/slippery.mp4 differ diff --git a/src/main/resources/videos/sony.mp4 b/src/main/resources/videos/sony.mp4 index 9d96aebfc39a033d379d613070c97e6122f8a175..158c13874cb0cd60ddbc9903b2658d4c0cfd2ded 100644 Binary files a/src/main/resources/videos/sony.mp4 and b/src/main/resources/videos/sony.mp4 differ diff --git a/src/main/resources/videos/top10Cats.mp4 b/src/main/resources/videos/top10Cats.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..9e0d5b532c067b4b7f5cb91402b91b71c9150261 Binary files /dev/null and b/src/main/resources/videos/top10Cats.mp4 differ diff --git a/src/main/resources/videos/waaahhh.mp4 b/src/main/resources/videos/waaahhh.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..1cba56386170639d4ad38f06caf09a5520d743de Binary files /dev/null and b/src/main/resources/videos/waaahhh.mp4 differ diff --git a/src/main/resources/videos/wolf.mp4 b/src/main/resources/videos/wolf.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..353523836c06ad5601edb60be81a99ebc644675e Binary files /dev/null and b/src/main/resources/videos/wolf.mp4 differ diff --git a/src/main/resources/videos/wooOOoo.mp4 b/src/main/resources/videos/wooOOoo.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..094c0d8df46be0db2aa87e3294d3fdfbf4ee4bd3 Binary files /dev/null and b/src/main/resources/videos/wooOOoo.mp4 differ diff --git a/src/main/resources/videos/yoinkySploinky.mp4 b/src/main/resources/videos/yoinkySploinky.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..ea88b4578ccc74f0228669792b4266b9860e3f0c Binary files /dev/null and b/src/main/resources/videos/yoinkySploinky.mp4 differ