From 87ce108bd1805201c8f54026f550fd0b6f0cef8a Mon Sep 17 00:00:00 2001 From: Willem Date: Wed, 2 Mar 2022 02:13:37 +0100 Subject: [PATCH] Fixed full screen mode and back --- .../gdxapp4d/vrgem4/GDXAppVrGem4Activator.java | 8 ++++---- .../gdxapp4d/vrgem4/desktop/DeskTopScreenMenu.java | 9 ++++++--- .../gdxapp4d/vrgem4/screen/AbstractScreenDesktop.java | 9 +++++---- .../gdxapp4d/vrgem4/screen/ScreenDesktop1.java | 11 +++-------- .../gdxapp4d/vrgem4/screen/ScreenDesktop2.java | 11 +++-------- .../gdxapp4d/vrgem4/screen/ScreenDesktop3.java | 5 +++-- .../gdxapp4d/vrgem4/screen/ScreenDesktop4.java | 5 +++-- 7 files changed, 27 insertions(+), 31 deletions(-) diff --git a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/GDXAppVrGem4Activator.java b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/GDXAppVrGem4Activator.java index e4171e81..dad6e7a5 100644 --- a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/GDXAppVrGem4Activator.java +++ b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/GDXAppVrGem4Activator.java @@ -129,10 +129,10 @@ public class GDXAppVrGem4Activator implements BundleActivator { Gdx.app.postRunnable(new Runnable() { @Override public void run() { - terminal.registrateScreen(new ScreenDesktop1()); - terminal.registrateScreen(new ScreenDesktop2()); - terminal.registrateScreen(new ScreenDesktop3()); - terminal.registrateScreen(new ScreenDesktop4()); + terminal.registrateScreen(new ScreenDesktop1(bootArgs)); + terminal.registrateScreen(new ScreenDesktop2(bootArgs)); + terminal.registrateScreen(new ScreenDesktop3(bootArgs)); + terminal.registrateScreen(new ScreenDesktop4(bootArgs)); terminal.registrateScreen(new ScreenCredits()); terminal.registrateScreen(new ScreenHelp()); terminal.registrateScreen(new ScreenIntroMission()); diff --git a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/desktop/DeskTopScreenMenu.java b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/desktop/DeskTopScreenMenu.java index 07f54bad..6538d2f5 100644 --- a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/desktop/DeskTopScreenMenu.java +++ b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/desktop/DeskTopScreenMenu.java @@ -8,6 +8,7 @@ import com.badlogic.gdx.Gdx; import imgui.ImGui; import imgui.type.ImBoolean; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; +import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs; import love.distributedrebirth.gdxapp4d.vrgem4.FontAwesomeIcons; import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppLauncher; import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4; @@ -28,12 +29,14 @@ import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenHelp; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") public class DeskTopScreenMenu { + private SystemWarpBootArgs bootArgs; private List apps; private ImBoolean fileMinimizeSelected = new ImBoolean(false); private ImBoolean fileCloseSelected = new ImBoolean(false); private ImBoolean tosSelfSelected = new ImBoolean(false); - public DeskTopScreenMenu() { + public DeskTopScreenMenu(SystemWarpBootArgs bootArgs) { + this.bootArgs = bootArgs; apps = new ArrayList<>(); apps.add(new GDXAppLauncher("Basic Console", () -> new BasicConsoleApp())); apps.add(new GDXAppLauncher("Sys Glyph Set", () -> new SystemBaseGlyphApp())); @@ -222,11 +225,11 @@ public class DeskTopScreenMenu { ImGui.separator(); if (Gdx.graphics.isFullscreen()) { if (ImGui.menuItem(FontAwesomeIcons.Wheelchair + " Window Mode")) { -// Gdx.graphics.setWindowedMode(GDXAppVrGem4.INSTANCE.viewWidth, GDXAppVrGem4.INSTANCE.viewHeight); + Gdx.graphics.setWindowedMode(bootArgs.getBootWindowWidth(), bootArgs.getBootWindowHeight()); } } else { if (ImGui.menuItem(FontAwesomeIcons.FighterJet + " Full Screen")) { -// Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); + Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); } } diff --git a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/AbstractScreenDesktop.java b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/AbstractScreenDesktop.java index f5860469..927dce6b 100644 --- a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/AbstractScreenDesktop.java +++ b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/AbstractScreenDesktop.java @@ -17,6 +17,7 @@ import imgui.ImGui; import imgui.flag.ImGuiCond; import imgui.flag.ImGuiWindowFlags; import imgui.type.ImBoolean; +import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs; import love.distributedrebirth.gdxapp4d.vrgem4.ImGuiSetup; import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskApp; import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppContourSection; @@ -41,8 +42,8 @@ public abstract class AbstractScreenDesktop extends ScreenAdapter implements Des private ModelBatch modelBatch; private Array modelInstances = new Array(); - public AbstractScreenDesktop(String name) { - this.create(); + public AbstractScreenDesktop(String name, SystemWarpBootArgs bootArgs) { + this.create(bootArgs); deskAppScreen = new DeskAppScreen(name); deskAppScreen.addDeskAppListener(new DeskAppScreenListener() { @@ -61,7 +62,7 @@ public abstract class AbstractScreenDesktop extends ScreenAdapter implements Des } - private void create() { + private void create(SystemWarpBootArgs bootArgs) { batch = new SpriteBatch(); font = new BitmapFont(); camera = new OrthographicCamera(); @@ -70,7 +71,7 @@ public abstract class AbstractScreenDesktop extends ScreenAdapter implements Des camera.update(); batch.setProjectionMatrix(camera.combined); - screenMenu = new DeskTopScreenMenu(); + screenMenu = new DeskTopScreenMenu(bootArgs); modelBatch = new ModelBatch(); diff --git a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop1.java b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop1.java index f175af6d..b4ea6ecb 100644 --- a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop1.java +++ b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop1.java @@ -1,8 +1,5 @@ package love.distributedrebirth.gdxapp4d.vrgem4.screen; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.ScreenAdapter; -import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.VertexAttributes.Usage; import com.badlogic.gdx.graphics.g3d.Material; import com.badlogic.gdx.graphics.g3d.Model; @@ -12,16 +9,14 @@ import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder; import com.badlogic.gdx.utils.Array; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; -import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4; -import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppScreen; -import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskTopScreen; +import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") public class ScreenDesktop1 extends AbstractScreenDesktop { private Model grid; - public ScreenDesktop1() { - super("Desktop1"); + public ScreenDesktop1(SystemWarpBootArgs bootArgs) { + super("Desktop1", bootArgs); //backgroundImage = new Texture(Gdx.files.internal("background/terrydavis-front.png")); } diff --git a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop2.java b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop2.java index 7db8d3a4..c5464132 100644 --- a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop2.java +++ b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop2.java @@ -1,8 +1,5 @@ package love.distributedrebirth.gdxapp4d.vrgem4.screen; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.ScreenAdapter; -import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.VertexAttributes.Usage; import com.badlogic.gdx.graphics.g3d.Material; import com.badlogic.gdx.graphics.g3d.Model; @@ -12,16 +9,14 @@ import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder; import com.badlogic.gdx.utils.Array; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; -import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4; -import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppScreen; -import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskTopScreen; +import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") public class ScreenDesktop2 extends AbstractScreenDesktop { private Model grid; - public ScreenDesktop2() { - super("Desktop2"); + public ScreenDesktop2(SystemWarpBootArgs bootArgs) { + super("Desktop2", bootArgs); //backgroundImage = new Texture(Gdx.files.internal("background/terrydavis-nose.png")); } diff --git a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop3.java b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop3.java index 24b6df4f..3c764c94 100644 --- a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop3.java +++ b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop3.java @@ -9,13 +9,14 @@ import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder; import com.badlogic.gdx.utils.Array; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; +import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") public class ScreenDesktop3 extends AbstractScreenDesktop { private Model grid; - public ScreenDesktop3() { - super("Desktop3"); + public ScreenDesktop3(SystemWarpBootArgs bootArgs) { + super("Desktop3", bootArgs); } protected void createModel(ModelBuilder modelBuilder, Array modelInstances) { diff --git a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop4.java b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop4.java index c9b49d33..e2822537 100644 --- a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop4.java +++ b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/screen/ScreenDesktop4.java @@ -20,6 +20,7 @@ import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.viewport.ScreenViewport; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; +import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") public class ScreenDesktop4 extends AbstractScreenDesktop { @@ -35,8 +36,8 @@ public class ScreenDesktop4 extends AbstractScreenDesktop { private float colorFade = 0f; private boolean colorPositive = true; - public ScreenDesktop4() { - super("Desktop4"); + public ScreenDesktop4(SystemWarpBootArgs bootArgs) { + super("Desktop4", bootArgs); shader = new UserColorShader(); shader.init(); font = new BitmapFont();