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
This commit is contained in:
Ticho Hidding
2025-10-01 15:54:18 +02:00
65 changed files with 2542 additions and 961 deletions

View File

@@ -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();
}
}
}

View File

@@ -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());
}
}

View File

@@ -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());
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

Before

Width:  |  Height:  |  Size: 956 B

After

Width:  |  Height:  |  Size: 956 B

View File

Before

Width:  |  Height:  |  Size: 189 KiB

After

Width:  |  Height:  |  Size: 189 KiB

View File

Before

Width:  |  Height:  |  Size: 15 MiB

After

Width:  |  Height:  |  Size: 15 MiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@@ -0,0 +1 @@
Super gaaf!