From c5219ce1009e67b34172a834634e3dbe55137e47 Mon Sep 17 00:00:00 2001 From: Sen Date: Tue, 18 Mar 2025 11:20:11 +0100 Subject: [PATCH] fullscreen --- java/src/game/Game.java | 2 +- java/src/game/gui/GuiDisplay.java | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/java/src/game/Game.java b/java/src/game/Game.java index fa398cd..12afd8d 100755 --- a/java/src/game/Game.java +++ b/java/src/game/Game.java @@ -1976,7 +1976,7 @@ public class Game implements IThreadListener { } public void full(boolean full) { - if(full != fullscreen && (!full || vidMode != null)) { + if((full != fullscreen || full) && (!full || vidMode != null)) { if(full) { Window.setFullscreen(vidMode.width, vidMode.height, vidMode.refresh); } diff --git a/java/src/game/gui/GuiDisplay.java b/java/src/game/gui/GuiDisplay.java index d37568e..44ded66 100644 --- a/java/src/game/gui/GuiDisplay.java +++ b/java/src/game/gui/GuiDisplay.java @@ -4,6 +4,7 @@ import game.color.TextColor; import game.gui.element.Dropdown; import game.gui.element.Fill; import game.gui.element.Slider; +import game.gui.element.Toggle; import game.util.Formatter; import game.window.DisplayMode; import game.window.Window; @@ -32,13 +33,19 @@ public class GuiDisplay extends GuiOptions { this.add(new Dropdown(30, 80, 440, 24, false, modes, modes[modes.length - 1], selected, new Dropdown.Callback() { public void use(Dropdown elem, DisplayMode value) { GuiDisplay.this.gm.vidMode = value; + GuiDisplay.this.gm.full(true); } }, "Auflösung")); } else { - this.add(new Fill(30, 80, 440, 24, TextColor.RED + "Auflösung: ")); + this.add(new Fill(30, 80, 440, 24, TextColor.RED + "Auflösung: ")); } - + + this.add(new Toggle(490, 80, 440, 24, false, GuiDisplay.this.gm.fullscreen, new Toggle.Callback() { + public void use(Toggle elem, boolean value) { + GuiDisplay.this.gm.full(value); + } + }, "Vollbild")); this.add(new Slider(30, 120, 440, 24, 0, 0, 360 - 8, 0, (this.gm.sync < 0) ? (360 - 8) : (this.gm.sync != 0 ? ((this.gm.sync < 10) ? 1 : (this.gm.sync - 9)) : 0), new Slider.Callback() { public void use(Slider elem, int value) { GuiDisplay.this.gm.getVar("win_sync").parse("" + ((value > 0 && value < 360 - 8) ? (value + 9) : (value != 0 ? -1 : 0)));