Merge remote-tracking branch 'origin/UI' into UI
# Conflicts: # .idea/misc.xml # app/src/main/java/org/toop/app/menu/MainMenu.java # app/src/main/java/org/toop/app/menu/QuitMenu.java
42
app/pom.xml
@@ -6,6 +6,7 @@
|
||||
<version>0.1</version>
|
||||
|
||||
<properties>
|
||||
<main-class>org.toop.Main</main-class>
|
||||
<maven.compiler.source>25</maven.compiler.source>
|
||||
<maven.compiler.target>25</maven.compiler.target>
|
||||
|
||||
@@ -13,6 +14,12 @@
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.diffplug.spotless</groupId>
|
||||
<artifactId>spotless-maven-plugin</artifactId>
|
||||
<version>2.46.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.toop</groupId>
|
||||
<artifactId>pism_framework</artifactId>
|
||||
@@ -46,6 +53,41 @@
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.diffplug.spotless</groupId>
|
||||
<artifactId>spotless-maven-plugin</artifactId>
|
||||
<version>2.46.1</version>
|
||||
<configuration>
|
||||
<!-- optional: limit format enforcement to just the files changed by this feature branch -->
|
||||
<ratchetFrom>origin/main</ratchetFrom>
|
||||
<formats>
|
||||
<!-- you can define as many formats as you want, each is independent -->
|
||||
<format>
|
||||
<!-- define the files to apply to -->
|
||||
<includes>
|
||||
<include>.gitattributes</include>
|
||||
<include>.gitignore</include>
|
||||
</includes>
|
||||
<!-- define the steps to apply to those files -->
|
||||
<trimTrailingWhitespace/>
|
||||
<endWithNewline/>
|
||||
<indent>
|
||||
<tabs>true</tabs>
|
||||
<spacesPerTab>4</spacesPerTab>
|
||||
</indent>
|
||||
</format>
|
||||
</formats>
|
||||
<!-- define a language-specific format -->
|
||||
<java>
|
||||
<googleJavaFormat>
|
||||
<version>1.28.0</version>
|
||||
<style>AOSP</style> <!-- GOOGLE (2 indents), AOSP (4 indents) -->
|
||||
<reflowLongStrings>true</reflowLongStrings>
|
||||
<formatJavadoc>true</formatJavadoc>
|
||||
</googleJavaFormat>
|
||||
</java>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,6 +1,9 @@
|
||||
package org.toop;
|
||||
|
||||
import org.toop.app.App;
|
||||
import org.toop.framework.asset.AssetLoader;
|
||||
import org.toop.framework.asset.AssetManager;
|
||||
import org.toop.framework.audio.SoundManager;
|
||||
import org.toop.framework.networking.NetworkingClientManager;
|
||||
import org.toop.framework.networking.NetworkingInitializationException;
|
||||
|
||||
@@ -11,6 +14,8 @@ public class Main {
|
||||
}
|
||||
|
||||
private static void initSystems() throws NetworkingInitializationException {
|
||||
new NetworkingClientManager();
|
||||
AssetManager.loadAssets(new AssetLoader("app/src/main/resources/assets"));
|
||||
new Thread(NetworkingClientManager::new).start();
|
||||
new Thread(SoundManager::new).start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ import org.toop.local.AppContext;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
import org.toop.framework.asset.AssetManager;
|
||||
import org.toop.framework.asset.resources.CssAsset;
|
||||
import org.toop.framework.asset.resources.ImageAsset;
|
||||
|
||||
public final class MainMenu extends Menu {
|
||||
private Locale currentLocale = AppContext.getLocale();
|
||||
@@ -22,17 +25,27 @@ public final class MainMenu extends Menu {
|
||||
final Button battleship = createButton(resourceBundle.getString("mainMenuSelectBattleship"), () -> {});
|
||||
final Button other = createButton(resourceBundle.getString("mainMenuSelectOther"), () -> {});
|
||||
|
||||
final VBox gamesBox = new VBox(tictactoe, reversi, sudoku, background, other);
|
||||
final VBox gamesBox = new VBox(tictactoe, reversi, sudoku, battleship, other);
|
||||
gamesBox.setAlignment(Pos.TOP_CENTER);
|
||||
|
||||
final Button credits = createButton(resourceBundle.getString("mainMenuSelectCredits"), () -> {});
|
||||
final Button options = createButton(resourceBundle.getString("mainMenuSelectOptions"), () -> {});
|
||||
final Button quit = createButton(resourceBundle.getString("mainMenuSelectQuit"), () -> {});
|
||||
|
||||
final VBox creditsBox = new VBox(10, credits, options, quit);
|
||||
final VBox creditsBox = new VBox(credits, options, quit);
|
||||
creditsBox.setAlignment(Pos.BOTTOM_CENTER);
|
||||
|
||||
VBox grid = new VBox(20, gamesBox, creditsBox);
|
||||
grid.setAlignment(Pos.CENTER);
|
||||
|
||||
ImageAsset backgroundImage = (ImageAsset) AssetManager.getByName("background.jpg").getResource();
|
||||
ImageView background = new ImageView(backgroundImage.getImage());
|
||||
background.setPreserveRatio(false);
|
||||
background.fitWidthProperty().bind(grid.widthProperty());
|
||||
background.fitHeightProperty().bind(grid.heightProperty());
|
||||
|
||||
pane = new StackPane(background, grid);
|
||||
pane.getStylesheets().add(getClass().getResource("/style/main.css").toExternalForm());
|
||||
CssAsset css = (CssAsset) AssetManager.getByName("main.css").getResource();
|
||||
pane.getStylesheets().add(css.getUrl());
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@ import javafx.scene.layout.StackPane;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Text;
|
||||
import org.toop.app.App;
|
||||
import org.toop.framework.asset.AssetManager;
|
||||
import org.toop.framework.asset.resources.CssAsset;
|
||||
import org.toop.local.AppContext;
|
||||
|
||||
import java.util.Locale;
|
||||
@@ -49,6 +51,7 @@ public final class QuitMenu extends Menu {
|
||||
StackPane.setAlignment(box, Pos.CENTER);
|
||||
|
||||
pane = modalContainer;
|
||||
pane.getStylesheets().add(getClass().getResource("/style/quit.css").toExternalForm());
|
||||
CssAsset css = (CssAsset) AssetManager.getByName("quit.css").getResource();
|
||||
pane.getStylesheets().add(css.getUrl());
|
||||
}
|
||||
}
|
||||
BIN
app/src/main/resources/assets/audio/dramatic.wav
Normal file
BIN
app/src/main/resources/assets/audio/hitsound0.wav
Normal file
BIN
app/src/main/resources/assets/audio/hitsound1.wav
Normal file
BIN
app/src/main/resources/assets/audio/mainmenu.wav
Normal file
BIN
app/src/main/resources/assets/audio/sadtrombone.wav
Normal file
BIN
app/src/main/resources/assets/audio/scawymusic.wav
Normal file
BIN
app/src/main/resources/assets/audio/suspensful.wav
Normal file
BIN
app/src/main/resources/assets/audio/testsound.wav
Normal file
BIN
app/src/main/resources/assets/audio/winsound.wav
Normal file
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 1.9 MiB After Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 956 B After Width: | Height: | Size: 956 B |
|
Before Width: | Height: | Size: 189 KiB After Width: | Height: | Size: 189 KiB |
|
Before Width: | Height: | Size: 15 MiB After Width: | Height: | Size: 15 MiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
1
app/src/main/resources/assets/text/test.txt
Normal file
@@ -0,0 +1 @@
|
||||
Super gaaf!
|
||||