diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/Main.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/Main.java
index f8deb83..7b55201 100644
--- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/Main.java
+++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/Main.java
@@ -9,6 +9,7 @@
import edu.ntnu.idi.idatt2003.g40.mappe.service.event.EventManager;
import edu.ntnu.idi.idatt2003.g40.mappe.utils.ConfigValues;
import edu.ntnu.idi.idatt2003.g40.mappe.view.ViewManager;
+import edu.ntnu.idi.idatt2003.g40.mappe.view.ingame.InGameController;
import edu.ntnu.idi.idatt2003.g40.mappe.view.ingame.InGameView;
import edu.ntnu.idi.idatt2003.g40.mappe.view.mainmenu.MainMenuController;
import edu.ntnu.idi.idatt2003.g40.mappe.view.mainmenu.MainMenuView;
@@ -19,6 +20,8 @@
import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;
+
+import edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.WidgetEnum;
import edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.financialsummary.SummaryController;
import edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.financialsummary.SummaryView;
import edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.dashboard.DashBoardController;
@@ -134,6 +137,10 @@ public void start(final Stage stage) throws Exception {
// In-game (Change "topBarView" to "topBarView2" if no summary section).
// Dashboard er default center-view.
InGameView inGameView = new InGameView(topBarView, dashBoardView.getRootPane());
+ InGameController inGameController = new InGameController(
+ inGameView,
+ eventManager
+ );
// Transaction history page
TransactionsView transactionsView = new TransactionsView();
@@ -189,6 +196,14 @@ public void start(final Stage stage) throws Exception {
viewManager.addView(inGameView);
viewManager.setScene(mainMenuView);
+ // Register all widgets
+ inGameController.addwidget(WidgetEnum.DASHBOARD, dashBoardView.getRootPane());
+ inGameController.addwidget(WidgetEnum.MARKET, marketView.getRootPane());
+ inGameController.addwidget(WidgetEnum.MINIGAMES_OVERVIEW, miniGamesView.getRootPane());
+ inGameController.addwidget(WidgetEnum.MINIGAMES_ENGINE, gameEngineView.getRootPane());
+ inGameController.addwidget(WidgetEnum.STATS, statsView.getRootPane());
+ inGameController.addwidget(WidgetEnum.TRANSACTIONS, transactionsView.getRootPane());
+
stage.show();
}
}
\ No newline at end of file
diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/service/event/EventType.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/service/event/EventType.java
index 4231866..777602d 100644
--- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/service/event/EventType.java
+++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/service/event/EventType.java
@@ -22,7 +22,21 @@ public enum EventType implements EventChannel {
* @see edu.ntnu.idi.idatt2003.g40.mappe.view.ViewManager
*
*/
- SCENE_CHANGE;
+ SCENE_CHANGE,
+
+ /**
+ * Event type representing events that causes the center view in the
+ * current {@link edu.ntnu.idi.idatt2003.g40.mappe.view.ingame.InGameView}
+ * object to change.
+ *
+ *
Primarily handled by the active
+ * {@link edu.ntnu.idi.idatt2003.g40.mappe.view.ingame.InGameController}
+ * object.
+ *
+ * @see edu.ntnu.idi.idatt2003.g40.mappe.view.ingame.InGameController
+ *
+ */
+ CHANGE_INGAME_CENTER;
/**
* {@inheritDoc}
diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ViewController.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ViewController.java
index fed6cfa..63a2ec3 100644
--- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ViewController.java
+++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ViewController.java
@@ -82,6 +82,17 @@ protected void changeScene(final ViewEnum viewName) {
invoke(eventData, eventManager);
}
+ /**
+ * Overloaded invoke method to reduce parameters, by using
+ * internal reference to event manager.
+ *
+ * @param the type of data to send.
+ * @param data the data to send.
+ * */
+ protected void invoke(final EventData data) {
+ invoke(data, eventManager);
+ }
+
@Override
public final void invoke(final EventData data,
final EventManager eventManager) {
diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ingame/InGameView.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ingame/InGameView.java
index b3b00b7..29a298d 100644
--- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ingame/InGameView.java
+++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ingame/InGameView.java
@@ -1,23 +1,12 @@
package edu.ntnu.idi.idatt2003.g40.mappe.view.ingame;
-import edu.ntnu.idi.idatt2003.g40.mappe.model.Stock;
import edu.ntnu.idi.idatt2003.g40.mappe.view.ViewElement;
import edu.ntnu.idi.idatt2003.g40.mappe.view.ViewEnum;
import edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.topbar.TopBarView;
-import javafx.geometry.Pos;
import javafx.scene.Node;
-import javafx.scene.chart.LineChart;
-import javafx.scene.chart.NumberAxis;
-import javafx.scene.chart.XYChart;
-import javafx.scene.control.Button;
-import javafx.scene.control.Label;
-import javafx.scene.control.Separator;
-import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
-import java.util.ArrayList;
-
public class InGameView extends ViewElement {
private final TopBarView topBarView;
diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/financialsummary/SummaryView.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/financialsummary/SummaryView.java
index 092e407..9c3b899 100644
--- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/financialsummary/SummaryView.java
+++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/financialsummary/SummaryView.java
@@ -89,6 +89,7 @@ protected void initLayout() {
navInfo.setAlignment(Pos.TOP_CENTER);
nextBtn = new Button("next");
+ nextBtn.setFocusTraversable(false);
weekLabel = new Label("week: 1");
weekLabel.getStyleClass().add("week-label");
Region spacerR = new Region();
diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/GameEngineView.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/GameEngineView.java
index 7cfa586..379d6f7 100644
--- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/GameEngineView.java
+++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/GameEngineView.java
@@ -1,6 +1,7 @@
package edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.minigames;
import edu.ntnu.idi.idatt2003.g40.mappe.view.ViewElement;
+import java.util.function.IntConsumer;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
@@ -8,22 +9,67 @@
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
-import java.util.function.IntConsumer;
+/**
+ * Minigame context class as described in the Strategy pattern.
+ *
+ * Extends {@link ViewElement}
+ * */
+public final class GameEngineView
+ extends ViewElement {
-public final class GameEngineView extends ViewElement {
+ /**
+ * Quit button (does not generate results).
+ * */
private Button quitButton;
+
+ /**
+ * Label for current score.
+ * */
private Label scoreLabel;
+
+ /**
+ * Label for time left.
+ * */
private Label timerLabel;
+
+ /**
+ * Label for current rank.
+ * */
private Label rankLabel;
+
+ /**
+ * Container for score, timer and rank.
+ * */
private HBox topDashboardBar;
- private int curScore;
+ /**
+ * Container for final game status report.
+ * */
private VBox reportContainer;
+
+ /**
+ * Label for report title.
+ * */
private Label reportTitleLabel;
+
+ /**
+ * Label for result rank.
+ * */
private Label rankResultLabel;
+
+ /**
+ * Label for describing what effects on the stock will apply.
+ * */
private Label stockEffectLabel;
+
+ /**
+ * Return button on the report (generates results on the stock market).
+ * */
private Button closeReportBtn;
+ /**
+ * Constructor.
+ * */
public GameEngineView() {
super(new BorderPane(), MiniGamesActions.class);
}
@@ -32,12 +78,12 @@ public GameEngineView() {
* Method for updating the game per tick with score, time and rank.
*
* @param score the score to show.
- * @param time the time to show.
- * @param rank the rank to show.
+ * @param time the time to show.
+ * @param rank the rank to show.
* */
public void updateMetadataDisplay(final int score,
final String time,
- final String rank) {
+ final char rank) {
scoreLabel.setText("Score: " + score);
timerLabel.setText(time);
rankLabel.setText("Rank: " + rank);
@@ -58,35 +104,30 @@ public void setGameGimmickContent(final GameGimmick gimmick, final IntConsumer c
/**
* Displays the report after a minigames timers is finished.
*
- * @param rank the rank the player got.
- * @param stockSymbol the symbol of the affected stock.
- * @param isPositive whether the change is positive or not.
+ * @param rank the rank the player got.
+ * @param effect the effect caused by the results.
* */
- public void showGameReport(final String rank,
- final String stockSymbol,
- final boolean isPositive) {
+ public void showGameReport(final char rank,
+ final String effect) {
getRootPane().setCenter(null);
- reportContainer = new VBox(25);
- reportContainer.setAlignment(Pos.CENTER);
- reportContainer.getStyleClass().add("minigames-report-box");
+ reportContainer = new VBox();
+ reportContainer.getStyleClass().add("gameEngine-report-box");
reportTitleLabel = new Label("GAME OVER - REPORT");
- reportTitleLabel.setStyle("-fx-font-size: 32px; -fx-font-weight: bold;");
+ reportTitleLabel.getStyleClass().add("gameEngine-report-title");
rankResultLabel = new Label("Final Rank: " + rank);
- rankResultLabel.setStyle("-fx-font-size: 24px;");
+ rankResultLabel.getStyleClass().add("gameEngine-report-rank-result");
- String effectText = isPositive
+ /*String effectText = isPositive
? "Performance impact: Positive change for " + stockSymbol + " next week! 📈"
: "Performance impact: Negative change for " + stockSymbol + " next week... 📉";
- stockEffectLabel = new Label(effectText);
- stockEffectLabel.setStyle("-fx-font-size: 18px; -fx-text-fill: " + (isPositive ? "green;" : "red;"));
- closeReportBtn = new Button("Return to Menu");
- closeReportBtn.setPrefSize(200, 50);
- registerButton(MiniGamesActions.CLOSE_REPORT, closeReportBtn);
+ stockEffectLabel.setStyle("-fx-font-size: 18px; -fx-text-fill: " + (isPositive ? "green;" : "red;"));*/
+ stockEffectLabel = new Label(effect);
+ stockEffectLabel.getStyleClass().add("gameEngine-report-effect");
reportContainer.getChildren().addAll(reportTitleLabel, rankResultLabel, stockEffectLabel, closeReportBtn);
getRootPane().setCenter(reportContainer);
@@ -96,6 +137,7 @@ public void showGameReport(final String rank,
protected void initLayout() {
quitButton = new Button("Quit");
quitButton.setPrefSize(100, 50);
+ quitButton.setFocusTraversable(false);
scoreLabel = new Label("Score: 0");
timerLabel = new Label("00:00:60");
@@ -107,17 +149,22 @@ protected void initLayout() {
topDashboardBar = new HBox(20, quitButton, statsDisplay);
topDashboardBar.setAlignment(Pos.CENTER_LEFT);
topDashboardBar.setPadding(new javafx.geometry.Insets(15));
+ closeReportBtn = new Button("Return");
+ closeReportBtn.setFocusTraversable(false);
getRootPane().setTop(topDashboardBar);
+
registerButton(MiniGamesActions.INGAME_QUIT, quitButton);
+ registerButton(MiniGamesActions.INGAME_RETURN, closeReportBtn);
}
@Override
protected void initStyling() {
- getRootPane().setStyle("-fx-background-color: rgba(180, 180, 180, 0.85);");
- topDashboardBar.setStyle("-fx-background-color: transparent;");
- scoreLabel.setStyle("-fx-font-size: 24px; -fx-text-fill: black;");
- timerLabel.setStyle("-fx-font-size: 24px; -fx-text-fill: black;");
- rankLabel.setStyle("-fx-font-size: 24px; -fx-text-fill: black;");
+ getRootPane().getStyleClass().add("gameEngine-root");
+ topDashboardBar.getStyleClass().add("gameEngine-topBar");
+ scoreLabel.getStyleClass().add("gameEngine-topBar-Label");
+ timerLabel.getStyleClass().add("gameEngine-topBar-Label");
+ rankLabel.getStyleClass().add("gameEngine-topBar-Label");
+ closeReportBtn.getStyleClass().add("gameEngine-report-closeButton");
}
}
diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/MiniGamesActions.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/MiniGamesActions.java
index c15b43c..279d17d 100644
--- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/MiniGamesActions.java
+++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/MiniGamesActions.java
@@ -25,12 +25,12 @@ public enum MiniGamesActions {
HELP,
/**
- * Action called when quitting a minigame.
+ * Action called when quitting a minigame (no reward).
* */
INGAME_QUIT,
/**
- * Action called when closing the report at the end of a minigame.
+ * Action for when a player returns from a minigame (with rewards).
* */
- CLOSE_REPORT
+ INGAME_RETURN;
}
diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/MiniGamesController.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/MiniGamesController.java
index da8bcbe..ee9a2d9 100644
--- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/MiniGamesController.java
+++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/MiniGamesController.java
@@ -14,14 +14,55 @@
* Extends {@link ViewController}
* */
public final class MiniGamesController extends ViewController {
+
+ /**
+ * The currently selected stock for the minigame.
+ * */
private Stock activeStock;
+
+ /**
+ * The game engine view to delegate games towards.
+ * */
private final GameEngineView gameEngineView;
+
+ /**
+ * The game engine controller.
+ * */
private final GameEngineController gameEngineController;
+
+ /**
+ * The clicker game instance.
+ * */
private final ClickerGame clickerGame;
+
+ /**
+ * The in game view.
+ * */
private final InGameView inGameView;
+
+ /**
+ * The find stock game instance.
+ * */
private final FindStockGame findStockGame;
+
+ /**
+ * The timed inputs game instance.
+ * */
private final TimeInputsGame timeInputsGame;
+ /**
+ * Constructor.
+ *
+ * @param viewElement the associated {@link MiniGamesView}.
+ * @param eventManager the associated {@link EventManager}.
+ * @param initialStock the initial selected stock.
+ * @param gameEngineView the game engine view.
+ * @param gameEngineController the game engine controller.
+ * @param clickerGame the clicker game instance.
+ * @param inGameView the in game view instance.
+ * @param findStockGame the find stock game instance.
+ * @param timeInputsGame the timed inputs game.
+ * */
public MiniGamesController(final MiniGamesView viewElement,
final EventManager eventManager,
final Stock initialStock,
@@ -30,7 +71,8 @@ public MiniGamesController(final MiniGamesView viewElement,
final ClickerGame clickerGame,
final InGameView inGameView,
final FindStockGame findStockGame,
- final TimeInputsGame timeInputsGame) {
+ final TimeInputsGame timeInputsGame
+ ) {
this.activeStock = initialStock;
this.gameEngineView = gameEngineView;
this.gameEngineController = gameEngineController;
@@ -71,6 +113,7 @@ protected void initInteractions() {
*/
public void setActiveStock(final Stock stock) {
this.activeStock = stock;
+ gameEngineController.setChosenStock(stock);
refresh();
}
diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/MiniGamesView.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/MiniGamesView.java
index 6d854d4..ca00af3 100644
--- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/MiniGamesView.java
+++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/MiniGamesView.java
@@ -1,8 +1,6 @@
package edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.minigames;
import edu.ntnu.idi.idatt2003.g40.mappe.view.ViewElement;
-import javafx.geometry.Pos;
-import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
@@ -12,20 +10,67 @@
/**
* Minigames view in the in game section of the application.
+ *
+ * Extends {@link ViewElement}
+ *
+ * Functions as an overview page before choosing a game.
+ * To see the elements creating the minigames themselves,
+ * see {@link GameEngineView}.
* */
public final class MiniGamesView extends ViewElement {
+ /**
+ * Top section of the page (Title, selected stock, question mark block).
+ * */
private HBox headerBar;
+
+ /**
+ * Container for games boxes.
+ * */
private HBox gamesContainer;
+ /**
+ * Row containing "Stock Selected:" and current stock.
+ * */
+ private HBox stockSelectionRow;
+
+ /**
+ * Title (Minigames).
+ * */
private Label titleLabel;
+
+ /**
+ * Selected stock.
+ * */
private Label selectedStockLabel;
+
+ /**
+ * Stock symbol box.
+ * */
private Label stockValueLabel;
+ /**
+ * Question mark button (displays a short tutorial).
+ * */
private Button helpBtn;
+
+ /**
+ * Button to start an
+ * {@link edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.minigames.games.ClickerGame} instance.
+ * */
private Button clickerGameBtn;
+
+ /**
+ * Button to start an
+ * {@link edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.minigames.games.FindStockGame} instance.
+ * */
private Button findStockBtn;
- private Button timeClicksBtn;
+
+ /**
+ * Button to start an
+ * {@link edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.minigames.games.TimeInputsGame} instance.
+ * */
+ private Button timeInputsBtn;
/**
* Constructor.
@@ -36,19 +81,15 @@ public MiniGamesView() throws IllegalArgumentException {
@Override
protected void initLayout() {
- // Top header layout
headerBar = new HBox();
- headerBar.setAlignment(Pos.TOP_LEFT);
-
- VBox titleSection = new VBox();
titleLabel = new Label("Mini games");
- HBox stockSelectionRow = new HBox();
- stockSelectionRow.setAlignment(Pos.CENTER_LEFT);
+ stockSelectionRow = new HBox();
selectedStockLabel = new Label("Selected stock: ");
stockValueLabel = new Label("AAPL");
stockSelectionRow.getChildren().addAll(selectedStockLabel, stockValueLabel);
+ VBox titleSection = new VBox();
titleSection.getChildren().addAll(titleLabel, stockSelectionRow);
Region topSpacer = new Region();
@@ -57,41 +98,26 @@ protected void initLayout() {
helpBtn = new Button("?");
headerBar.getChildren().addAll(titleSection, topSpacer, helpBtn);
- // Main central row container for games
gamesContainer = new HBox();
- gamesContainer.setAlignment(Pos.CENTER);
clickerGameBtn = new Button("Clicker game");
- findStockBtn = new Button("Find correct\nstock");
- timeClicksBtn = new Button("Time your clicks");
+ findStockBtn = new Button("Find stock");
+ timeInputsBtn = new Button("Timed inputs");
- // Make buttons fill equal proportions
HBox.setHgrow(clickerGameBtn, Priority.ALWAYS);
HBox.setHgrow(findStockBtn, Priority.ALWAYS);
- HBox.setHgrow(timeClicksBtn, Priority.ALWAYS);
-
- // Equal constraints on dimensions
- configureGameButton(clickerGameBtn);
- configureGameButton(findStockBtn);
- configureGameButton(timeClicksBtn);
+ HBox.setHgrow(timeInputsBtn, Priority.ALWAYS);
- gamesContainer.getChildren().addAll(clickerGameBtn, findStockBtn, timeClicksBtn);
+ gamesContainer.getChildren().addAll(clickerGameBtn,
+ findStockBtn, timeInputsBtn);
- // Assemble view layers
VBox.setVgrow(gamesContainer, Priority.ALWAYS);
getRootPane().getChildren().addAll(headerBar, gamesContainer);
- // Map interactions
registerButton(MiniGamesActions.HELP, helpBtn);
registerButton(MiniGamesActions.CLICKER_GAME, clickerGameBtn);
registerButton(MiniGamesActions.FIND_STOCK, findStockBtn);
- registerButton(MiniGamesActions.TIME_CLICKS, timeClicksBtn);
- }
-
- private void configureGameButton(final Button btn) {
- btn.setMaxWidth(Double.MAX_VALUE);
- btn.setMaxHeight(Double.MAX_VALUE);
- btn.setAlignment(Pos.CENTER);
+ registerButton(MiniGamesActions.TIME_CLICKS, timeInputsBtn);
}
/**
@@ -107,6 +133,7 @@ public void setSelectedStockText(final String symbol) {
protected void initStyling() {
getRootPane().getStyleClass().add("minigames-root");
headerBar.getStyleClass().add("minigames-headerBar");
+ stockSelectionRow.getStyleClass().add("minigames-stockSelectionRow");
titleLabel.getStyleClass().add("minigames-titleLabel");
selectedStockLabel.getStyleClass().add("minigames-stockLabel");
stockValueLabel.getStyleClass().add("minigames-stockValue");
@@ -116,6 +143,6 @@ protected void initStyling() {
clickerGameBtn.getStyleClass().add("minigames-cardBtn");
findStockBtn.getStyleClass().add("minigames-cardBtn");
- timeClicksBtn.getStyleClass().add("minigames-cardBtn");
+ timeInputsBtn.getStyleClass().add("minigames-cardBtn");
}
}
diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/topbar/TopBarView.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/topbar/TopBarView.java
index 3be0fcf..471dfbb 100644
--- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/topbar/TopBarView.java
+++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/topbar/TopBarView.java
@@ -51,9 +51,9 @@ protected void initLayout() {
transactionsBtn = new Button("Transactions");
minigamesBtn = new Button("Minigames");
-
Stream.of(quitBtn, statsBtn, marketBtn, settingsBtn, transactionsBtn, minigamesBtn).forEach(b -> {
HBox.setHgrow(b, Priority.ALWAYS);
+ b.setFocusTraversable(false);
});
navRow.getChildren().addAll(
diff --git a/src/main/resources/styles.css b/src/main/resources/styles.css
index 1a753f3..ad0cde6 100644
--- a/src/main/resources/styles.css
+++ b/src/main/resources/styles.css
@@ -807,9 +807,14 @@
}
.minigames-headerBar {
+ -fx-alignment: TOP_LEFT;
-fx-padding: 10px 0px;
}
+.minigames-stockSelectionRow {
+ -fx-alignment: CENTER_LEFT;
+}
+
.minigames-titleLabel {
-fx-font-size: 48px;
-fx-font-family: "Aptos", "Segoe UI", sans-serif;
@@ -841,11 +846,13 @@
}
.minigames-container {
+ -fx-alignment: CENTER;
-fx-spacing: 30px;
-fx-padding: 10px 0px;
}
.minigames-cardBtn {
+ -fx-alignment: CENTER;
-fx-background-color: #d8d8d8;
-fx-border-color: #000000;
-fx-border-width: 1.5px;
@@ -861,7 +868,52 @@
-fx-background-color: #c0c0c0;
}
/* --------------------------------------------- */
-/* --------------- FIND STOCK GAME ------------*/
+/* --------- MINIGAMES ENGINE CONTEXT ---------- */
+.gameEngine-root {
+ -fx-background-color: rgba(180, 180, 180, 0.85);
+}
+
+.gameEngine-topBar {
+ -fx-background-color: transparent;
+}
+
+.gameEngine-topBar-Label {
+ -fx-font-size: 24px;
+ -fx-text-fill: black;
+}
+
+.gameEngine-report-box {
+ -fx-spacing: 25px;
+ -fx-alignment: CENTER;
+ -fx-background-color: #ffffff;
+ -fx-border-color: #000000;
+ -fx-border-width: 2px;
+ -fx-padding: 40px;
+ -fx-max-width: 500px;
+ -fx-max-height: 350px;
+ -fx-background-radius: 5px;
+ -fx-border-radius: 5px;
+}
+
+.gameEngine-report-title {
+ -fx-font-size: 32px;
+ -fx-font-weight: bold;
+}
+
+.gameEngine-report-rank-result {
+ -fx-font-size: 24px;
+}
+
+.gameEngine-report-effect {
+ -fx-font-size: 18px;
+}
+
+.gameEngine-report-closeButton {
+ -fx-pref-width: 200;
+ -fx-pref-height: 50;
+}
+/* ----------------------------------------------*/
+/* --------------- FIND STOCK GAME ------------- */
.find-stock-minigame-root {
-fx-spacing: 15;
-fx-alignment: CENTER;