From c2d5370073ccb9f5723c2089812d538607621ec3 Mon Sep 17 00:00:00 2001 From: Willem Date: Tue, 15 Feb 2022 19:35:05 +0100 Subject: [PATCH] Removed menu rendering from app main. --- .../distributedrebirth/gdxapp/GDXAppMain.java | 267 +---------------- .../gdxapp/GDXAppScreen.java | 10 - .../gdxapp/desktop/DeskTopScreen.java | 11 + .../gdxapp/desktop/DeskTopScreenMenu.java | 276 ++++++++++++++++++ .../gdxapp/screen/AbstractScreenDesktop.java | 4 +- .../gdxapp/screen/ScreenDesktop1.java | 4 +- .../gdxapp/screen/ScreenDesktop2.java | 4 +- 7 files changed, 307 insertions(+), 269 deletions(-) delete mode 100644 main-gdxapp/src/main/love/distributedrebirth/gdxapp/GDXAppScreen.java create mode 100644 main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskTopScreen.java create mode 100644 main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskTopScreenMenu.java diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/GDXAppMain.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/GDXAppMain.java index 96c501e9..8ef42a7f 100644 --- a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/GDXAppMain.java +++ b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/GDXAppMain.java @@ -1,6 +1,5 @@ package love.distributedrebirth.gdxapp; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -20,15 +19,10 @@ import imgui.type.ImBoolean; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ; import love.distributedrebirth.bassboonyd.jmx.DefaultEnumBaseᴶᴹˣ; -import love.distributedrebirth.gdxapp.desktop.DeskApp; import love.distributedrebirth.gdxapp.desktop.DeskAppContourSection; import love.distributedrebirth.gdxapp.desktop.DeskAppRenderer; -import love.distributedrebirth.gdxapp.desktop.apps.BasicConsoleApp; -import love.distributedrebirth.gdxapp.desktop.apps.HebrewWalletApp; -import love.distributedrebirth.gdxapp.desktop.apps.MusicPlayerApp; -import love.distributedrebirth.gdxapp.desktop.apps.SystemBaseGlyphApp; -import love.distributedrebirth.gdxapp.desktop.apps.SystemBasePartApp; -import love.distributedrebirth.gdxapp.desktop.apps.Unicode4DApp; +import love.distributedrebirth.gdxapp.desktop.DeskTopScreen; +import love.distributedrebirth.gdxapp.desktop.DeskTopScreenMenu; import love.distributedrebirth.gdxapp.music.MusicManager; import love.distributedrebirth.gdxapp.music.MusicSongType; import love.distributedrebirth.gdxapp.screen.ScreenCredits; @@ -62,14 +56,10 @@ public class GDXAppMain extends Game { public final int viewWidth; public final int viewHeight; public MusicManager music; - + public ImBoolean showImGuiDemo = new ImBoolean(false); private Map,Screen> screens; - private List apps; - private GDXAppScreen desktop1; - private GDXAppScreen desktop2; - private GDXAppScreen desktop3; - private GDXAppScreen desktop4; - private ImBoolean showImGuiDemo = new ImBoolean(false); + private DeskTopScreenMenu screenMenu; + public GDXAppMain(List args, int viewWidth, int viewHeight, NativeFileChooser fileChooser) { this.args = args; @@ -154,18 +144,12 @@ public class GDXAppMain extends Game { music.init(musicStop); screens = new HashMap<>(); - apps = new ArrayList<>(); - apps.add(new GDXAppLauncher("Basic Console", () -> new BasicConsoleApp())); - apps.add(new GDXAppLauncher("Base Glyphs", () -> new SystemBaseGlyphApp())); - apps.add(new GDXAppLauncher("Base Parts", () -> new SystemBasePartApp())); - apps.add(new GDXAppLauncher("Hebrew Wallet", () -> new HebrewWalletApp())); - apps.add(new GDXAppLauncher("Unicode4D", () -> new Unicode4DApp())); - apps.add(new GDXAppLauncher("Music Player", () -> new MusicPlayerApp(this))); - desktop1 = new ScreenDesktop1(this); - desktop2 = new ScreenDesktop2(this); - desktop3 = new ScreenDesktop3(); - desktop4 = new ScreenDesktop4(); + DeskTopScreen desktop1 = new ScreenDesktop1(this); + DeskTopScreen desktop2 = new ScreenDesktop2(this); + DeskTopScreen desktop3 = new ScreenDesktop3(); + DeskTopScreen desktop4 = new ScreenDesktop4(); + screenMenu = new DeskTopScreenMenu(this, desktop1, desktop2, desktop3, desktop4); putScreen(new ScreenLoading(this)); putScreen(new ScreenIntro(this)); @@ -217,10 +201,10 @@ public class GDXAppMain extends Game { ImGuiSetup.imGuiImp.newFrame(); ImGui.newFrame(); - GDXAppScreen appScreen = null; - if (screen instanceof GDXAppScreen) { - appScreen = GDXAppScreen.class.cast(screen); - renderMenu(appScreen); + DeskTopScreen appScreen = null; + if (screen instanceof DeskTopScreen) { + appScreen = DeskTopScreen.class.cast(screen); + screenMenu.renderMenu(appScreen); } if (showImGuiDemo.get()) { ImGui.showDemoWindow(showImGuiDemo); @@ -244,227 +228,4 @@ public class GDXAppMain extends Game { ImGui.render(); ImGuiSetup.imGuiGlImp.renderDrawData(ImGui.getDrawData()); } - - private ImBoolean fileMinimizeSelected = new ImBoolean(false); - private ImBoolean fileCloseSelected = new ImBoolean(false); - - private void renderMenu(GDXAppScreen appScreen) { - DeskApp deskApp = appScreen.getDeskAppScreen().getCurrentDeskApp(); - ImGui.beginMainMenuBar(); - - if (ImGui.beginMenu("vrGEM⁴")) { - String infix1 = ""; - String infix2 = ""; - String infix3 = ""; - String infix4 = ""; - if (appScreen instanceof ScreenDesktop1) { - infix1 = "=> "; - } - if (appScreen instanceof ScreenDesktop2) { - infix2 = "=> "; - } - if (appScreen instanceof ScreenDesktop3) { - infix3 = "=> "; - } - if (appScreen instanceof ScreenDesktop4) { - infix4 = "=> "; - } - if (ImGui.beginMenu(infix1+"Desktop1")) { - if (ImGui.menuItem("Main reality")) { - selectScreen(ScreenDesktop1.class); - desktop1.getDeskAppScreen().setCurrentDeskApp(null); - } - for (DeskApp app: desktop1.getDeskAppScreen().getDeskApps()) { - if (ImGui.menuItem(app.getTitle())) { - selectScreen(ScreenDesktop1.class); - desktop1.getDeskAppScreen().setCurrentDeskApp(app); - } - } - ImGui.endMenu(); - } - if (ImGui.beginMenu(infix2+"Desktop2")) { - if (ImGui.menuItem("Main reality")) { - selectScreen(ScreenDesktop2.class); - desktop2.getDeskAppScreen().setCurrentDeskApp(null); - } - for (DeskApp app: desktop2.getDeskAppScreen().getDeskApps()) { - if (ImGui.menuItem(app.getTitle())) { - selectScreen(ScreenDesktop2.class); - desktop2.getDeskAppScreen().setCurrentDeskApp(app); - } - } - ImGui.endMenu(); - } - if (ImGui.beginMenu(infix3+"Desktop3")) { - if (ImGui.menuItem("Main reality")) { - selectScreen(ScreenDesktop3.class); - desktop3.getDeskAppScreen().setCurrentDeskApp(null); - } - for (DeskApp app: desktop3.getDeskAppScreen().getDeskApps()) { - if (ImGui.menuItem(app.getTitle())) { - selectScreen(ScreenDesktop3.class); - desktop3.getDeskAppScreen().setCurrentDeskApp(app); - } - } - ImGui.endMenu(); - } - if (ImGui.beginMenu(infix4+"Desktop4")) { - if (ImGui.menuItem("Main reality")) { - selectScreen(ScreenDesktop4.class); - desktop4.getDeskAppScreen().setCurrentDeskApp(null); - } - for (DeskApp app: desktop4.getDeskAppScreen().getDeskApps()) { - if (ImGui.menuItem(app.getTitle())) { - selectScreen(ScreenDesktop4.class); - desktop4.getDeskAppScreen().setCurrentDeskApp(app); - } - } - ImGui.endMenu(); - } - ImGui.separator(); - if (ImGui.beginMenu("Start App")) { - for (GDXAppLauncher launcher: apps) { - if (ImGui.menuItem(launcher.getName())) { - appScreen.getDeskAppScreen().addDeskApp(launcher.getLauncher().get()); - } - } - ImGui.endMenu(); - } - if (ImGui.menuItem("Run App")) { - } - ImGui.separator(); - if (Gdx.graphics.isFullscreen()) { - if (ImGui.menuItem("Window Mode")) { - Gdx.graphics.setWindowedMode(viewWidth, viewHeight); - } - } else { - if (ImGui.menuItem("Full Screen")) { - Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); - } - } - ImGui.separator(); - if (ImGui.menuItem("Credits")) { - selectScreen(ScreenCredits.class); - } - if (ImGui.menuItem("Help")) { - selectScreen(ScreenHelp.class); - } - ImGui.separator(); - if (ImGui.menuItem("ImGui Demo")) { - showImGuiDemo.set(true); - } - if (ImGui.menuItem("Shutdown")) { - dispose(); - System.exit(0); - } - ImGui.endMenu(); - } - - - if (deskApp != null) { - renderEditMenu(deskApp); - renderFileMenu(deskApp); - } - - if (deskApp != null) { - if (ImGui.beginMenu(deskApp.getTitle())) { - if (ImGui.menuItem("Minimize", "", fileMinimizeSelected, deskApp != null )) { - fileMinimizeSelected.set(false); - if (deskApp != null) { - appScreen.getDeskAppScreen().setCurrentDeskApp(null); - } - } - if (ImGui.menuItem("Exit", "", fileCloseSelected, deskApp != null)) { - fileCloseSelected.set(false); - if (deskApp != null) { - appScreen.getDeskAppScreen().removeDeskApp(deskApp); - appScreen.getDeskAppScreen().setCurrentDeskApp(null); - } - } - ImGui.endMenu(); - } - } - - - ImGui.endMainMenuBar(); - } - - private void renderFileMenu(DeskApp deskApp) { - DeskAppRenderer fileNew = deskApp.getContours().getContour(DeskAppContourSection.FILE_NEW); - DeskAppRenderer fileClose = deskApp.getContours().getContour(DeskAppContourSection.FILE_CLOSE); - DeskAppRenderer fileSave = deskApp.getContours().getContour(DeskAppContourSection.FILE_SAVE); - DeskAppRenderer fileOption = deskApp.getContours().getContour(DeskAppContourSection.FILE_OPTION); - DeskAppRenderer filePrint = deskApp.getContours().getContour(DeskAppContourSection.FILE_PRINT); - if (fileNew == null && fileClose == null && fileSave == null && fileOption == null && filePrint == null) { - return; - } - if (ImGui.beginMenu("File")) { - if (fileNew != null) { - fileNew.render(); - ImGui.separator(); - } - if (fileClose != null) { - fileClose.render(); - ImGui.separator(); - } - if (fileSave != null) { - fileSave.render(); - ImGui.separator(); - } - if (fileOption != null) { - fileOption.render(); - ImGui.separator(); - } - if (filePrint != null) { - filePrint.render(); - } - ImGui.endMenu(); - } - } - - private void renderEditMenu(DeskApp deskApp) { - DeskAppRenderer editUndo = deskApp.getContours().getContour(DeskAppContourSection.EDIT_UNDO); - DeskAppRenderer editCopy = deskApp.getContours().getContour(DeskAppContourSection.EDIT_COPY); - DeskAppRenderer editSelect = deskApp.getContours().getContour(DeskAppContourSection.EDIT_SELECT); - DeskAppRenderer editFind = deskApp.getContours().getContour(DeskAppContourSection.EDIT_FIND); - DeskAppRenderer editOption = deskApp.getContours().getContour(DeskAppContourSection.EDIT_OPTION); - if (editUndo != null || editCopy != null || editSelect != null || editFind != null || editOption != null) { - boolean first = false; - if (ImGui.beginMenu("Edit")) { - if (editUndo != null) { - editUndo.render(); - first = true; - } - if (editCopy != null) { - if (first) { - ImGui.separator(); - } - editCopy.render(); - first = true; - } - if (editSelect != null) { - if (first) { - ImGui.separator(); - } - editSelect.render(); - first = true; - } - if (editFind != null) { - if (first) { - ImGui.separator(); - } - editFind.render(); - first = true; - } - if (editOption != null) { - if (first) { - ImGui.separator(); - } - editOption.render(); - first = true; - } - ImGui.endMenu(); - } - } - } } diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/GDXAppScreen.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/GDXAppScreen.java deleted file mode 100644 index be83c6ea..00000000 --- a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/GDXAppScreen.java +++ /dev/null @@ -1,10 +0,0 @@ -package love.distributedrebirth.gdxapp; - -import com.badlogic.gdx.Screen; - -import love.distributedrebirth.gdxapp.desktop.DeskAppScreen; - -public interface GDXAppScreen extends Screen { - - DeskAppScreen getDeskAppScreen(); -} diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskTopScreen.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskTopScreen.java new file mode 100644 index 00000000..9b762ce9 --- /dev/null +++ b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskTopScreen.java @@ -0,0 +1,11 @@ +package love.distributedrebirth.gdxapp.desktop; + +import com.badlogic.gdx.Screen; + +import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +public interface DeskTopScreen extends Screen { + + DeskAppScreen getDeskAppScreen(); +} diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskTopScreenMenu.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskTopScreenMenu.java new file mode 100644 index 00000000..1648816a --- /dev/null +++ b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskTopScreenMenu.java @@ -0,0 +1,276 @@ +package love.distributedrebirth.gdxapp.desktop; + +import java.util.ArrayList; +import java.util.List; + +import com.badlogic.gdx.Gdx; + +import imgui.ImGui; +import imgui.type.ImBoolean; +import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; +import love.distributedrebirth.gdxapp.GDXAppLauncher; +import love.distributedrebirth.gdxapp.GDXAppMain; +import love.distributedrebirth.gdxapp.desktop.apps.BasicConsoleApp; +import love.distributedrebirth.gdxapp.desktop.apps.HebrewWalletApp; +import love.distributedrebirth.gdxapp.desktop.apps.MusicPlayerApp; +import love.distributedrebirth.gdxapp.desktop.apps.SystemBaseGlyphApp; +import love.distributedrebirth.gdxapp.desktop.apps.SystemBasePartApp; +import love.distributedrebirth.gdxapp.desktop.apps.Unicode4DApp; +import love.distributedrebirth.gdxapp.screen.ScreenCredits; +import love.distributedrebirth.gdxapp.screen.ScreenDesktop1; +import love.distributedrebirth.gdxapp.screen.ScreenDesktop2; +import love.distributedrebirth.gdxapp.screen.ScreenDesktop3; +import love.distributedrebirth.gdxapp.screen.ScreenDesktop4; +import love.distributedrebirth.gdxapp.screen.ScreenHelp; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +public class DeskTopScreenMenu { + + private final GDXAppMain main; + private final DeskTopScreen desktop1; + private final DeskTopScreen desktop2; + private final DeskTopScreen desktop3; + private final DeskTopScreen desktop4; + private List apps; + private ImBoolean fileMinimizeSelected = new ImBoolean(false); + private ImBoolean fileCloseSelected = new ImBoolean(false); + + public DeskTopScreenMenu(final GDXAppMain main, DeskTopScreen desktop1, DeskTopScreen desktop2, + DeskTopScreen desktop3, DeskTopScreen desktop4) { + this.main = main; + this.desktop1 = desktop1; + this.desktop2 = desktop2; + this.desktop3 = desktop3; + this.desktop4 = desktop4; + + apps = new ArrayList<>(); + apps.add(new GDXAppLauncher("Basic Console", () -> new BasicConsoleApp())); + apps.add(new GDXAppLauncher("Base Glyphs", () -> new SystemBaseGlyphApp())); + apps.add(new GDXAppLauncher("Base Parts", () -> new SystemBasePartApp())); + apps.add(new GDXAppLauncher("Hebrew Wallet", () -> new HebrewWalletApp())); + apps.add(new GDXAppLauncher("Unicode4D", () -> new Unicode4DApp())); + apps.add(new GDXAppLauncher("Music Player", () -> new MusicPlayerApp(main))); + } + + public void renderMenu(DeskTopScreen appScreen) { + DeskApp deskApp = appScreen.getDeskAppScreen().getCurrentDeskApp(); + + ImGui.beginMainMenuBar(); + renderVRGEM4Menu(appScreen); + + if (deskApp != null) { + renderEditMenu(deskApp); + renderFileMenu(deskApp); + renderSelfMenu(appScreen, deskApp); + } + ImGui.endMainMenuBar(); + } + + private void renderSelfMenu(DeskTopScreen appScreen, DeskApp deskApp) { + if (ImGui.beginMenu(deskApp.getTitle())) { + if (ImGui.menuItem("Minimize", "", fileMinimizeSelected, deskApp != null )) { + fileMinimizeSelected.set(false); + if (deskApp != null) { + appScreen.getDeskAppScreen().setCurrentDeskApp(null); + } + } + if (ImGui.menuItem("Exit", "", fileCloseSelected, deskApp != null)) { + fileCloseSelected.set(false); + if (deskApp != null) { + appScreen.getDeskAppScreen().removeDeskApp(deskApp); + appScreen.getDeskAppScreen().setCurrentDeskApp(null); + } + } + ImGui.endMenu(); + } + } + + private void renderFileMenu(DeskApp deskApp) { + DeskAppRenderer fileNew = deskApp.getContours().getContour(DeskAppContourSection.FILE_NEW); + DeskAppRenderer fileClose = deskApp.getContours().getContour(DeskAppContourSection.FILE_CLOSE); + DeskAppRenderer fileSave = deskApp.getContours().getContour(DeskAppContourSection.FILE_SAVE); + DeskAppRenderer fileOption = deskApp.getContours().getContour(DeskAppContourSection.FILE_OPTION); + DeskAppRenderer filePrint = deskApp.getContours().getContour(DeskAppContourSection.FILE_PRINT); + if (fileNew == null && fileClose == null && fileSave == null && fileOption == null && filePrint == null) { + return; + } + if (ImGui.beginMenu("File")) { + if (fileNew != null) { + fileNew.render(); + ImGui.separator(); + } + if (fileClose != null) { + fileClose.render(); + ImGui.separator(); + } + if (fileSave != null) { + fileSave.render(); + ImGui.separator(); + } + if (fileOption != null) { + fileOption.render(); + ImGui.separator(); + } + if (filePrint != null) { + filePrint.render(); + } + ImGui.endMenu(); + } + } + + private void renderEditMenu(DeskApp deskApp) { + DeskAppRenderer editUndo = deskApp.getContours().getContour(DeskAppContourSection.EDIT_UNDO); + DeskAppRenderer editCopy = deskApp.getContours().getContour(DeskAppContourSection.EDIT_COPY); + DeskAppRenderer editSelect = deskApp.getContours().getContour(DeskAppContourSection.EDIT_SELECT); + DeskAppRenderer editFind = deskApp.getContours().getContour(DeskAppContourSection.EDIT_FIND); + DeskAppRenderer editOption = deskApp.getContours().getContour(DeskAppContourSection.EDIT_OPTION); + if (editUndo != null || editCopy != null || editSelect != null || editFind != null || editOption != null) { + boolean first = false; + if (ImGui.beginMenu("Edit")) { + if (editUndo != null) { + editUndo.render(); + first = true; + } + if (editCopy != null) { + if (first) { + ImGui.separator(); + } + editCopy.render(); + first = true; + } + if (editSelect != null) { + if (first) { + ImGui.separator(); + } + editSelect.render(); + first = true; + } + if (editFind != null) { + if (first) { + ImGui.separator(); + } + editFind.render(); + first = true; + } + if (editOption != null) { + if (first) { + ImGui.separator(); + } + editOption.render(); + first = true; + } + ImGui.endMenu(); + } + } + } + + private void renderVRGEM4Menu(DeskTopScreen appScreen) { + if (ImGui.beginMenu("vrGEM⁴")) { + String infix1 = ""; + String infix2 = ""; + String infix3 = ""; + String infix4 = ""; + if (appScreen instanceof ScreenDesktop1) { + infix1 = "=> "; + } + if (appScreen instanceof ScreenDesktop2) { + infix2 = "=> "; + } + if (appScreen instanceof ScreenDesktop3) { + infix3 = "=> "; + } + if (appScreen instanceof ScreenDesktop4) { + infix4 = "=> "; + } + if (ImGui.beginMenu(infix1+"Desktop1")) { + if (ImGui.menuItem("Main reality")) { + main.selectScreen(ScreenDesktop1.class); + desktop1.getDeskAppScreen().setCurrentDeskApp(null); + } + for (DeskApp app: desktop1.getDeskAppScreen().getDeskApps()) { + if (ImGui.menuItem(app.getTitle())) { + main.selectScreen(ScreenDesktop1.class); + desktop1.getDeskAppScreen().setCurrentDeskApp(app); + } + } + ImGui.endMenu(); + } + if (ImGui.beginMenu(infix2+"Desktop2")) { + if (ImGui.menuItem("Main reality")) { + main.selectScreen(ScreenDesktop2.class); + desktop2.getDeskAppScreen().setCurrentDeskApp(null); + } + for (DeskApp app: desktop2.getDeskAppScreen().getDeskApps()) { + if (ImGui.menuItem(app.getTitle())) { + main.selectScreen(ScreenDesktop2.class); + desktop2.getDeskAppScreen().setCurrentDeskApp(app); + } + } + ImGui.endMenu(); + } + if (ImGui.beginMenu(infix3+"Desktop3")) { + if (ImGui.menuItem("Main reality")) { + main.selectScreen(ScreenDesktop3.class); + desktop3.getDeskAppScreen().setCurrentDeskApp(null); + } + for (DeskApp app: desktop3.getDeskAppScreen().getDeskApps()) { + if (ImGui.menuItem(app.getTitle())) { + main.selectScreen(ScreenDesktop3.class); + desktop3.getDeskAppScreen().setCurrentDeskApp(app); + } + } + ImGui.endMenu(); + } + if (ImGui.beginMenu(infix4+"Desktop4")) { + if (ImGui.menuItem("Main reality")) { + main.selectScreen(ScreenDesktop4.class); + desktop4.getDeskAppScreen().setCurrentDeskApp(null); + } + for (DeskApp app: desktop4.getDeskAppScreen().getDeskApps()) { + if (ImGui.menuItem(app.getTitle())) { + main.selectScreen(ScreenDesktop4.class); + desktop4.getDeskAppScreen().setCurrentDeskApp(app); + } + } + ImGui.endMenu(); + } + ImGui.separator(); + if (ImGui.beginMenu("Start App")) { + for (GDXAppLauncher launcher: apps) { + if (ImGui.menuItem(launcher.getName())) { + appScreen.getDeskAppScreen().addDeskApp(launcher.getLauncher().get()); + } + } + ImGui.endMenu(); + } + if (ImGui.menuItem("Run App")) { + } + ImGui.separator(); + if (Gdx.graphics.isFullscreen()) { + if (ImGui.menuItem("Window Mode")) { + Gdx.graphics.setWindowedMode(main.viewWidth, main.viewHeight); + } + } else { + if (ImGui.menuItem("Full Screen")) { + Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); + } + } + ImGui.separator(); + if (ImGui.menuItem("Credits")) { + main.selectScreen(ScreenCredits.class); + } + if (ImGui.menuItem("Help")) { + main.selectScreen(ScreenHelp.class); + } + ImGui.separator(); + if (ImGui.menuItem("ImGui Demo")) { + main.showImGuiDemo.set(true); + } + if (ImGui.menuItem("Shutdown")) { + main.dispose(); + System.exit(0); + } + ImGui.endMenu(); + } + } +} diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/AbstractScreenDesktop.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/AbstractScreenDesktop.java index cd36b07a..a929c460 100644 --- a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/AbstractScreenDesktop.java +++ b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/AbstractScreenDesktop.java @@ -10,13 +10,13 @@ import com.badlogic.gdx.graphics.g3d.utils.FirstPersonCameraController; import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder; import com.badlogic.gdx.utils.Array; -import love.distributedrebirth.gdxapp.GDXAppScreen; import love.distributedrebirth.gdxapp.desktop.DeskApp; import love.distributedrebirth.gdxapp.desktop.DeskAppScreen; import love.distributedrebirth.gdxapp.desktop.DeskAppScreenListener; import love.distributedrebirth.gdxapp.desktop.FilteringInputProcessor; +import love.distributedrebirth.gdxapp.desktop.DeskTopScreen; -public abstract class AbstractScreenDesktop extends ScreenAdapter implements GDXAppScreen { +public abstract class AbstractScreenDesktop extends ScreenAdapter implements DeskTopScreen { private final DeskAppScreen deskAppScreen; private PerspectiveCamera cam; diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenDesktop1.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenDesktop1.java index 6b42763c..c075a0e2 100644 --- a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenDesktop1.java +++ b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenDesktop1.java @@ -6,11 +6,11 @@ import com.badlogic.gdx.graphics.Texture; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; import love.distributedrebirth.gdxapp.GDXAppMain; -import love.distributedrebirth.gdxapp.GDXAppScreen; import love.distributedrebirth.gdxapp.desktop.DeskAppScreen; +import love.distributedrebirth.gdxapp.desktop.DeskTopScreen; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") -public class ScreenDesktop1 extends ScreenAdapter implements GDXAppScreen { +public class ScreenDesktop1 extends ScreenAdapter implements DeskTopScreen { private final GDXAppMain main; private DeskAppScreen deskAppScreen; private Texture backgroundImage; diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenDesktop2.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenDesktop2.java index e8e5c0c8..450759bf 100644 --- a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenDesktop2.java +++ b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenDesktop2.java @@ -6,11 +6,11 @@ import com.badlogic.gdx.graphics.Texture; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; import love.distributedrebirth.gdxapp.GDXAppMain; -import love.distributedrebirth.gdxapp.GDXAppScreen; import love.distributedrebirth.gdxapp.desktop.DeskAppScreen; +import love.distributedrebirth.gdxapp.desktop.DeskTopScreen; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") -public class ScreenDesktop2 extends ScreenAdapter implements GDXAppScreen { +public class ScreenDesktop2 extends ScreenAdapter implements DeskTopScreen { private final GDXAppMain main; private DeskAppScreen deskAppScreen; private Texture backgroundImage;