From a3b36b29db3111df3811a9bd58fce20827f286e5 Mon Sep 17 00:00:00 2001 From: Moncef STITI Date: Sun, 17 Nov 2024 14:06:57 +0100 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20du=20code=20#2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/GameModeController.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/TestV2/src/fr/monkhanny/dorfromantik/controller/GameModeController.java b/TestV2/src/fr/monkhanny/dorfromantik/controller/GameModeController.java index ffabf4e..41380b3 100644 --- a/TestV2/src/fr/monkhanny/dorfromantik/controller/GameModeController.java +++ b/TestV2/src/fr/monkhanny/dorfromantik/controller/GameModeController.java @@ -1,15 +1,18 @@ package fr.monkhanny.dorfromantik.controller; import fr.monkhanny.dorfromantik.gui.GameModeSelectionPanel; -import fr.monkhanny.dorfromantik.game.Board; import fr.monkhanny.dorfromantik.gui.MainMenu; +import fr.monkhanny.dorfromantik.game.Board; import fr.monkhanny.dorfromantik.utils.Database; +import fr.monkhanny.dorfromantik.Options; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; import java.sql.SQLException; import java.sql.*; +import java.awt.Dimension; +import java.awt.Point; public class GameModeController implements ActionListener { @@ -92,6 +95,16 @@ public class GameModeController implements ActionListener { } private void startGame(String mode, long seed) { + if (Options.FULL_SCREEN) { + gameFrame.setExtendedState(JFrame.MAXIMIZED_BOTH); // Set frame to full screen + gameFrame.setUndecorated(true); + } else { + Dimension mainMenuSize = this.mainMenu.getSize(); + Point mainMenuLocation = this.mainMenu.getLocation(); + gameFrame.setSize(mainMenuSize); + gameFrame.setLocation(mainMenuLocation); + gameFrame.setUndecorated(false); + } Board board = new Board(this.gameFrame,seed); this.gameFrame.setVisible(true); this.gameFrame.add(board);