Fixed imgui demo screen

This commit is contained in:
Willem Cazander 2022-03-10 01:31:31 +01:00
parent 83eec6a1aa
commit cb03208ac1
7 changed files with 40 additions and 13 deletions

View file

@ -34,6 +34,6 @@ public class CalculatorComponent {
@Deactivate @Deactivate
void close() { void close() {
log.debug(this, SystemGdxLog.DEACTIVATE); log.debug(this, SystemGdxLog.DEACTIVATE);
deskAppService.installDeskApp(DeskAppMenuSection.PROGRAMMING, launcher); deskAppService.removeDeskApp(DeskAppMenuSection.PROGRAMMING, launcher);
} }
} }

View file

@ -34,6 +34,6 @@ public class HeWalletComponent {
@Deactivate @Deactivate
void close() { void close() {
log.debug(this, SystemGdxLog.DEACTIVATE); log.debug(this, SystemGdxLog.DEACTIVATE);
deskAppService.installDeskApp(DeskAppMenuSection.INTERNET, launcher); deskAppService.removeDeskApp(DeskAppMenuSection.INTERNET, launcher);
} }
} }

View file

@ -38,6 +38,6 @@ public class TosAmpComponent {
@Deactivate @Deactivate
void close() { void close() {
log.debug(this, SystemGdxLog.DEACTIVATE); log.debug(this, SystemGdxLog.DEACTIVATE);
deskAppService.installDeskApp(DeskAppMenuSection.MULTIMEDIA, launcher); deskAppService.removeDeskApp(DeskAppMenuSection.MULTIMEDIA, launcher);
} }
} }

View file

@ -16,7 +16,6 @@ import com.badlogic.gdx.utils.ScreenUtils;
import imgui.ImGui; import imgui.ImGui;
import imgui.flag.ImGuiCond; import imgui.flag.ImGuiCond;
import imgui.flag.ImGuiWindowFlags; import imgui.flag.ImGuiWindowFlags;
import imgui.type.ImBoolean;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootArgs; import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootArgs;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal; import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal;
import love.distributedrebirth.gdxapp4d.vrgem4.ImGuiSetup; import love.distributedrebirth.gdxapp4d.vrgem4.ImGuiSetup;
@ -35,7 +34,6 @@ public abstract class AbstractScreenDesktop extends ScreenAdapter implements Des
protected SpriteBatch batch; protected SpriteBatch batch;
protected BitmapFont font; protected BitmapFont font;
protected OrthographicCamera camera; protected OrthographicCamera camera;
protected ImBoolean showImGuiDemo = new ImBoolean(false);
private final DeskTopScreenMenu screenMenu; private final DeskTopScreenMenu screenMenu;
private final DeskAppController deskAppScreen; private final DeskAppController deskAppScreen;
private PerspectiveCamera cam; private PerspectiveCamera cam;
@ -128,9 +126,6 @@ public abstract class AbstractScreenDesktop extends ScreenAdapter implements Des
DeskTopScreen appScreen = this; DeskTopScreen appScreen = this;
screenMenu.renderMenu(appScreen); screenMenu.renderMenu(appScreen);
if (showImGuiDemo.get()) {
ImGui.showDemoWindow(showImGuiDemo);
}
if (appScreen != null && appScreen.getDeskAppController().getCurrentDeskApp() != null) { if (appScreen != null && appScreen.getDeskAppController().getCurrentDeskApp() != null) {
int sizeFlags = ImGuiCond.Always; int sizeFlags = ImGuiCond.Always;
ImGui.setNextWindowPos(0, 28, sizeFlags); ImGui.setNextWindowPos(0, 28, sizeFlags);

View file

@ -277,9 +277,6 @@ public class DeskTopScreenMenu {
terminal.selectScreen(ScreenHelp.class); terminal.selectScreen(ScreenHelp.class);
} }
ImGui.separator(); ImGui.separator();
if (ImGui.menuItem(FontAwesomeIcons.Trademark + " ImGui Demo")) {
// GDXAppVrGem4.INSTANCE.showImGuiDemo.set(true);
}
if (ImGui.menuItem(FontAwesomeIcons.PowerOff + " Shutdown")) { if (ImGui.menuItem(FontAwesomeIcons.PowerOff + " Shutdown")) {
bootArgs.shutdown(); bootArgs.shutdown();
} }

View file

@ -12,6 +12,7 @@ import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppLauncher;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppMenuSection; import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppMenuSection;
import love.distributedrebirth.gdxapp4d.vrsys5.apps.BaseUnicodePlaneDeskApp; import love.distributedrebirth.gdxapp4d.vrsys5.apps.BaseUnicodePlaneDeskApp;
import love.distributedrebirth.gdxapp4d.vrsys5.apps.BasicConsoleDeskApp; import love.distributedrebirth.gdxapp4d.vrsys5.apps.BasicConsoleDeskApp;
import love.distributedrebirth.gdxapp4d.vrsys5.apps.ImGuiDeskApp;
@Component @Component
public class VrSys5Component { public class VrSys5Component {
@ -27,10 +28,12 @@ public class VrSys5Component {
private final DeskAppLauncher basicLauncher; private final DeskAppLauncher basicLauncher;
private final DeskAppLauncher unicodeLauncher; private final DeskAppLauncher unicodeLauncher;
private final DeskAppLauncher imguiLauncher;
public VrSys5Component() { public VrSys5Component() {
basicLauncher = new DeskAppLauncher("Basic Console", () -> new BasicConsoleDeskApp()); basicLauncher = new DeskAppLauncher("Basic Console", () -> new BasicConsoleDeskApp());
unicodeLauncher = new DeskAppLauncher("Base Unicode Plane", () -> new BaseUnicodePlaneDeskApp(localeService)); unicodeLauncher = new DeskAppLauncher("Base Unicode Plane", () -> new BaseUnicodePlaneDeskApp(localeService));
imguiLauncher = new DeskAppLauncher("ImGui Demo", () -> new ImGuiDeskApp());
} }
@Activate @Activate
@ -38,12 +41,14 @@ public class VrSys5Component {
log.debug(this, SystemGdxLog.ACTIVATE); log.debug(this, SystemGdxLog.ACTIVATE);
deskAppService.installDeskApp(DeskAppMenuSection.SYSTEM, basicLauncher); deskAppService.installDeskApp(DeskAppMenuSection.SYSTEM, basicLauncher);
deskAppService.installDeskApp(DeskAppMenuSection.SYSTEM, unicodeLauncher); deskAppService.installDeskApp(DeskAppMenuSection.SYSTEM, unicodeLauncher);
deskAppService.installDeskApp(DeskAppMenuSection.PROGRAMMING, imguiLauncher);
} }
@Deactivate @Deactivate
void close() { void close() {
log.debug(this, SystemGdxLog.DEACTIVATE); log.debug(this, SystemGdxLog.DEACTIVATE);
deskAppService.installDeskApp(DeskAppMenuSection.SYSTEM, basicLauncher); deskAppService.removeDeskApp(DeskAppMenuSection.SYSTEM, basicLauncher);
deskAppService.installDeskApp(DeskAppMenuSection.SYSTEM, unicodeLauncher); deskAppService.removeDeskApp(DeskAppMenuSection.SYSTEM, unicodeLauncher);
deskAppService.removeDeskApp(DeskAppMenuSection.PROGRAMMING, imguiLauncher);
} }
} }

View file

@ -0,0 +1,30 @@
package love.distributedrebirth.gdxapp4d.vrsys5.apps;
import imgui.ImGui;
import imgui.type.ImBoolean;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.AbstractDeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppRenderer;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class ImGuiDeskApp extends AbstractDeskApp implements DeskAppRenderer {
protected ImBoolean showImGuiDemo = new ImBoolean(false);
public void create() {
getContours().setTitle("ImGui Demo");
getContours().registrateContour(DeskAppContourSection.MAIN, this);
}
@Override
public void render() {
ImGui.text("Display the ImGui demo window;");
if (ImGui.button("Show")) {
showImGuiDemo.set(true);
}
if (showImGuiDemo.get()) {
ImGui.showDemoWindow(showImGuiDemo);
}
}
}