Skip to content
Snippets Groups Projects
Commit 11c0c758 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #61

parent 088545c2
No related branches found
No related tags found
No related merge requests found
package de.bricked.game.settings;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
public enum GameSize
{
SMALL(800, 600),
NORMAL(1024, 768),
BIGGER(1280, 1024),
BIG(1920, 1080),
FULL_SCREEN();
BIG(1920, 1080);
private int width;
private int height;
......@@ -19,13 +16,6 @@ public enum GameSize
this.height = height;
}
GameSize()
{
GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
this.width = gd.getDisplayMode().getWidth();
this.height = gd.getDisplayMode().getHeight();
}
public int getWidth()
{
return width;
......
......@@ -6,7 +6,6 @@ import java.util.ResourceBundle;
import de.bricked.game.Game;
import de.bricked.game.levels.Level;
import de.bricked.game.settings.GameSize;
import de.bricked.ui.cells.LevelCell;
import javafx.application.Platform;
import javafx.collections.FXCollections;
......@@ -22,7 +21,6 @@ import javafx.scene.control.ListView;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.ScrollPane.ScrollBarPolicy;
import javafx.scene.image.Image;
import javafx.scene.input.KeyCombination;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
......@@ -149,19 +147,7 @@ public class LevelSelectController
Parent root = (Parent)fxmlLoader.load();
Stage newStage = new Stage();
// set stage size
if(game.getSettings().getGameSize().equals(GameSize.FULL_SCREEN))
{
newStage.setScene(new Scene(root));
newStage.setFullScreen(true);
newStage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);
}
else
{
newStage.setScene(new Scene(root, game.getSettings().getGameSize().getWidth(), game.getSettings().getGameSize().getHeight()));
}
newStage.setTitle(bundle.getString("app.name") + " - " + game.getLevel().getName());
newStage.initOwner(stage);
......
......@@ -11,16 +11,9 @@ public class ComboBoxResolutionCell extends ComboBoxListCell<GameSize>
super.updateItem(item, empty);
if( ! empty)
{
if(item == GameSize.FULL_SCREEN)
{
setText("Fullscreen");
}
else
{
setText(item.getWidth() + " x " + item.getHeight());
}
}
else
{
setText(null);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment