Easter cleaning git

This commit is contained in:
Willem Cazander 2025-04-27 00:09:28 +02:00
commit d0529bfadf
500 changed files with 116670 additions and 0 deletions

47
gdxapp4d-vrgem4/pom.xml Normal file
View file

@ -0,0 +1,47 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>gdxapp4d-vrgem4</artifactId>
<name>GDXApp⁴ᴰ-vrGEM⁴</name>
<packaging>bundle</packaging>
<dependencies>
<dependency>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d-tos4</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<exportScr>true</exportScr>
<niceManifest>true</niceManifest>
<instructions>
<_donotcopy>(.git)</_donotcopy>
<_dsannotations>*</_dsannotations>
<_metatypeannotations>*</_metatypeannotations>
<Import-Package>
${tos4.packages}
</Import-Package>
<Export-Package>
org.slf4j.impl,
love.distributedrebirth.gdxapp4d.vrgem4.service,
love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp
</Export-Package>
<Private-Package>love.distributedrebirth.gdxapp4d.vrgem4.*</Private-Package>
<Bundle-Activator>love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4Activator</Bundle-Activator>
<Bundle-Vendor>distributedrebirth.love</Bundle-Vendor>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,266 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4;
import java.io.File;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.ServiceReference;
import com.badlogic.gdx.Gdx;
import imgui.type.ImBoolean;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpCore;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootArgs;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootReadyListener;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxFont;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxLog;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpShip;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpSea;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenCredits;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop1;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop2;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop3;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop4;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenHelp;
import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4DeskAppService;
import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4Unicode4DService;
import love.distributedrebirth.warpme.ship.WaterShipWarp;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.BãßBȍőn𓄯;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᐪᓫᕽᐪ.ᓑᣕᣳᒼᐤᒄᓫ.BaseGlyphSet;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ.TTꞱꞱᖟGateway;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᔿᣔᐪᣗᑊᕁ.NumberMatrixFactory;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class GDXAppVrGem4Activator implements BundleActivator {
private static final int VIEW_SLEEP_TIME = 1234;
private ImGuiSetup imguiSetup = new ImGuiSetup();
@Override
public void stop(final BundleContext context) {
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
imguiSetup.dispose();
}
});
}
@Override
public void start(final BundleContext context) {
try {
Thread.sleep(VIEW_SLEEP_TIME);
} catch (InterruptedException ignored) {
}
ServiceReference<SystemGdxLog> loggerRef = context.getServiceReference(SystemGdxLog.class);
SystemGdxLog logger = context.getService(loggerRef);
ServiceReference<SystemGdxTerminal> termRef = context.getServiceReference(SystemGdxTerminal.class);
SystemGdxTerminal terminal = context.getService(termRef);
ServiceReference<SystemGdxFont> gdxFontRef = context.getServiceReference(SystemGdxFont.class);
SystemGdxFont gdxFont = context.getService(gdxFontRef);
ServiceReference<SystemWarpShip> systemWarpShipRef = context.getServiceReference(SystemWarpShip.class);
SystemWarpShip systemWarpShip = context.getService(systemWarpShipRef);
ServiceReference<SystemGdxBootArgs> bootArgsRef = context.getServiceReference(SystemGdxBootArgs.class);
SystemGdxBootArgs bootArgs = context.getService(bootArgsRef);
logger.info(this, "Booting");
GDXAppVrGem4BootScreen bootScreen = createBootScreen(terminal, gdxFont);
printBootLogo(bootScreen);
lockGraves(bootScreen);
startImGui(bootScreen, context, systemWarpShip);
startWarpCore(bootScreen, bootArgs);
VrGem4DeskAppServiceImpl deskAppService = new VrGem4DeskAppServiceImpl();
context.registerService(VrGem4DeskAppService.class.getName(), deskAppService, new Hashtable<String, String>());
startTerminalScreens(bootScreen, bootArgs, terminal, deskAppService);
List<SystemWarpSea> registratedSeas = new ArrayList<>();
int result = 0;
try {
for (WaterShipWarp ocean:systemWarpShip.getWarpShip().theShip().getWarpSeas()) {
result = systemWarpShip.loadWaterOcean(context, registratedSeas, ocean.getSea(), v -> bootScreen.bootLine(v));
}
} catch (Exception e) {
e.printStackTrace();
bootScreen.bootLine("ERROR: "+e.getMessage());
return;
}
if (result > 0) {
bootScreen.bootLine("vrGEM4: FAILURE BOOT ABORTED");
return;
}
bootScreen.bootLine("vrGEM4: chains resolved.");
try {
systemWarpShip.loadBundles(context, registratedSeas);
} catch (BundleException e) {
e.printStackTrace();
bootScreen.bootLine("ERROR: "+e.getMessage());
return;
}
bootArgs.addBootReadyListener(new SystemGdxBootReadyListener() {
@Override
public void bootCompleted() {
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
terminal.selectScreen(ScreenDesktop1.class);
terminal.disposeScreen(bootScreen);
}
});
logger.info(this, "Boot done");
}
});
VrGem4Unicode4DServiceImpl unicodeService = new VrGem4Unicode4DServiceImpl();
unicodeService.init(context, systemWarpShip, (v) -> bootScreen.bootLine(v));
context.registerService(VrGem4Unicode4DService.class.getName(), unicodeService, new Hashtable<String, String>());
startBundles(bootScreen);
}
private GDXAppVrGem4BootScreen createBootScreen(SystemGdxTerminal terminal, SystemGdxFont gdxFont) {
GDXAppVrGem4BootScreen bootScreen = new GDXAppVrGem4BootScreen(gdxFont.getFont());
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
bootScreen.create();
terminal.registrateScreen(bootScreen);
terminal.selectScreen(GDXAppVrGem4BootScreen.class);
}
});
try {
Thread.sleep(100);
} catch (InterruptedException ignored) {
}
return bootScreen;
}
private void printBootLogo(GDXAppVrGem4BootScreen bootScreen) {
bootScreen.bootLine("==========================");
bootScreen.bootLine(" @Ω仙⁴ ˧꜏⋇꜊꜔ ⁴ﷲΩ@ ");
bootScreen.bootLine(" ©Δ∞ 仙上主天 ");
bootScreen.bootLine("בְּרֵאשִׁית :o: יְסוֺד :o: יִשְׂרָאֵל");
bootScreen.bootLine("==========================");
bootScreen.bootLine("Boot: MSX⁴ - TOS⁴ - vrGEM⁴");
}
private void lockGraves(GDXAppVrGem4BootScreen bootScreen) {
// ref to init
int lockCounter = 0;
for (BãßBȍőn𓄯<?> bassbone:bassboneInstances()) {
//StringUnicode exportName = bassbone.thisᵀᴮᵒⁿᵉᴳʳᵃᵛᵉ().gelṳidѴ(StringUnicode.class, .PaintColorExportArtifact.class);
//StringUnicode copyright = bassbone.thisᵀᴮᵒⁿᵉᴳʳᵃᵛᵉ().gelṳidѴ(BãßBȍőnDuytsDocAuthor響ᴼᶠ.class).kopieërRecht();
//bootScreen.bootLine("Lock: "+exportName/*+" since: "+copyright*/);
BãßBȍőn𓄯.亞ᶦᶦᶦ.thisʸᴰᐧᐧˡᵒᶜᵏ(bassbone);
lockCounter++;
}
bootScreen.bootLine("BãßBȍőn locked graves: " + lockCounter);
}
private void startImGui(GDXAppVrGem4BootScreen bootScreen, BundleContext context, SystemWarpShip systemWarpShip) {
List<File> fonts = systemWarpShip.searchMagic(context, "application/x-font-ttf-plane0");
bootScreen.bootLine("ImGui Setup");
ImBoolean imLoaded = new ImBoolean(false);
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
imguiSetup.init(fonts, v -> bootScreen.bootLine(v));
imLoaded.set(true);
}
});
while (!imLoaded.get()) {
try {
Thread.sleep(100);
} catch (InterruptedException ignored) {
}
}
bootScreen.bootLine("ImGui Loaded");
}
private void startWarpCore(GDXAppVrGem4BootScreen bootScreen, SystemGdxBootArgs bootArgs) {
if (!bootArgs.isWarpCoreNoLock()) {
bootScreen.bootLine("warpcore-lock: BãßLockWarpCipher");
SystemWarpCore.INSTANCE.BãßLockWarpCipher(v -> {});
} else {
bootScreen.bootLine("warpcore-nolock: requested");
}
}
private void startTerminalScreens(GDXAppVrGem4BootScreen bootScreen, SystemGdxBootArgs bootArgs, SystemGdxTerminal terminal, VrGem4DeskAppService deskAppService) {
bootScreen.bootLine("vrGEM⁴: add terminal screens");
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
terminal.registrateScreen(new ScreenDesktop1(bootArgs, terminal, deskAppService));
terminal.registrateScreen(new ScreenDesktop2(bootArgs, terminal, deskAppService));
terminal.registrateScreen(new ScreenDesktop3(bootArgs, terminal, deskAppService));
terminal.registrateScreen(new ScreenDesktop4(bootArgs, terminal, deskAppService));
terminal.registrateScreen(new ScreenCredits(terminal));
terminal.registrateScreen(new ScreenHelp(terminal));
}
});
try {
Thread.sleep(100);
} catch (InterruptedException ignored) {
}
}
private void startBundles(GDXAppVrGem4BootScreen bootScreen) {
try {
Thread.sleep(VIEW_SLEEP_TIME);
} catch (InterruptedException ignored) {
}
bootScreen.bootLine("vrGEM4: Init bundles...");
}
@SuppressWarnings("unchecked")
private <T extends BãßBȍőn𓄯<?>> T[] bassboneInstances() {
return (T[]) new BãßBȍőn𓄯[] {
BaseGlyphSet.values()[0],
TTꞱꞱᖟGateway.,
SystemWarpCore.INSTANCE,
NumberMatrixFactory.INSTANCE
};
}
}

View file

@ -0,0 +1,36 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public interface GDXAppVrGem4BootListener {
void bootLine(String message);
}

View file

@ -0,0 +1,91 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4;
import java.util.ArrayList;
import java.util.List;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class GDXAppVrGem4BootScreen extends ScreenAdapter implements GDXAppVrGem4BootListener {
private final BitmapFont font;
private SpriteBatch batch;
private Texture backgroundImage;
private List<String> messages = new ArrayList<>();
public GDXAppVrGem4BootScreen(BitmapFont font) {
this.font = font;
}
public void create() {
batch = new SpriteBatch();
backgroundImage = new Texture(Gdx.files.internal("background/gdxapp-loading.png"));
}
@Override
public void render(float delta) {
int textX = 40;
int textY = Gdx.graphics.getHeight();
int textYStep = 20;
batch.begin();
batch.draw(backgroundImage, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
synchronized (messages) {
int start = 0;
if (messages.size() > 33) {
start = messages.size() - 33;
}
List<String> part = messages.subList(start, messages.size());
for (String message:part) {
font.draw(batch, message, textX, textY-=textYStep);
}
}
batch.end();
}
@Override
public void dispose() {
batch.dispose();
backgroundImage.dispose();
font.dispose();
}
@Override
public void bootLine(String message) {
synchronized (messages) {
messages.add(message);
}
}
}

View file

@ -0,0 +1,114 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4;
import java.io.File;
import java.util.List;
import java.util.function.Consumer;
import com.badlogic.gdx.Gdx;
import imgui.ImFontConfig;
import imgui.ImFontGlyphRangesBuilder;
import imgui.ImGui;
import imgui.ImGuiIO;
import imgui.ImGuiStyle;
import imgui.flag.ImGuiBackendFlags;
import imgui.gl3.ImGuiImplGl3;
import imgui.glfw.ImGuiImplGlfw;
import love.distributedrebirth.unicode4d.draw.ImCharacter;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
/**
* Create and shutdown of ImGui and font activations.
*/
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class ImGuiSetup {
public final static ImGuiImplGlfw imGuiImp = new ImGuiImplGlfw();
public final static ImGuiImplGl3 imGuiGlImp = new ImGuiImplGl3();
public void init(List<File> fonts, Consumer<String> logger) {
long windowHandleᕯ = -1;
try {
Object window = Gdx.graphics.getClass().getMethod("getWindow").invoke(Gdx.graphics);
windowHandleᕯ = (Long)window.getClass().getMethod("getWindowHandle").invoke(window);
} catch (Exception e) {
throw new RuntimeException(e);
}
ImGui.createContext();
initFonts(ImGui.getIO(), fonts, logger);
imGuiImp.init(windowHandleᕯ, true);
imGuiGlImp.init("#version 140");
ImGui.getIO().setIniFilename(null);
ImGui.getIO().setBackendFlags(ImGuiBackendFlags.RendererHasVtxOffset);
ImGui.init();
initStyle();
}
private void initStyle() {
ImGui.styleColorsDark();
ImGuiStyle style = ImGui.getStyle();
style.setWindowRounding(0f);
style.setWindowBorderSize(0f);
style.setWindowPadding(6f, 6f);
style.setScrollbarSize(22f);
}
private void initFonts(final ImGuiIO io, List<File> fonts, Consumer<String> logger) {
ImFontConfig fontConfig = new ImFontConfig();
ImFontGlyphRangesBuilder fontBuilder = new ImFontGlyphRangesBuilder();
addRangeUnicodePlane0(fontBuilder);
final short[] glyphRanges = fontBuilder.buildRanges();
float fontSize = ImCharacter.HEIGHT;
boolean first = true;
for (File font: fonts) {
logger.accept("Load font: "+font);
io.getFonts().addFontFromMemoryTTF(Gdx.files.absolute(font.getAbsolutePath()).readBytes(), fontSize, fontConfig, glyphRanges);
if (first) {
fontConfig.setMergeMode(true);
first = false;
}
}
fontConfig.destroy();
}
private void addRangeUnicodePlane0(ImFontGlyphRangesBuilder fontBuilder) {
for (int c=0x0001;c<=0xFFEF;c++) {
StringBuilder buf = new StringBuilder();
buf.append(""+(char)c);
fontBuilder.addText(buf.toString());
}
}
public void dispose() {
imGuiImp.dispose();
imGuiGlImp.dispose();
ImGui.destroyContext();
}
}

View file

@ -0,0 +1,73 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4DeskAppService;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppLauncher;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppMenuSection;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class VrGem4DeskAppServiceImpl implements VrGem4DeskAppService {
private Map<DeskAppMenuSection, List<DeskAppLauncher>> menu = new HashMap<>();
private List<DeskAppLauncher> buildMenuSection(DeskAppMenuSection section) {
List<DeskAppLauncher> launchers = menu.get(section);
if (launchers == null) {
launchers = new ArrayList<>();
menu.put(section, launchers);
}
return launchers;
}
@Override
public List<DeskAppLauncher> getMenuSection(DeskAppMenuSection section) {
List<DeskAppLauncher> result = new ArrayList<>(buildMenuSection(section));
Collections.sort(result, (v1, v2) -> {
return v1.getName().compareTo(v2.getName()); // TODO: change data structure
});
return result;
}
@Override
public void installDeskApp(DeskAppLauncher launcher) {
buildMenuSection(launcher.getMenuSection()).add(launcher);
}
@Override
public void removeDeskApp(DeskAppLauncher launcher) {
buildMenuSection(launcher.getMenuSection()).remove(launcher);
}
}

View file

@ -0,0 +1,121 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Locale;
import java.util.Properties;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.component.annotations.Reference;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxLog;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBase;
import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4LocaleService;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@Component
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class VrGem4LocaleServiceImpl implements VrGem4LocaleService {
@Reference
private SystemGdxLog log;
@Reference
private SystemWarpBase warpBase;
private Properties properties;
enum LocaleKey {
TEXT_LOCALE,
NUMBER10_LOCALE,
NUMBER16_LOCALE,
NUMBER27_LOCALE,
}
public VrGem4LocaleServiceImpl() {
properties = new Properties();
}
private void save() {
File propFile = new File(warpBase.getWarpshipHome(), "etc/locale.xml");
try {
properties.storeToXML(new FileOutputStream(propFile), "Locales", StandardCharsets.UTF_8);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Activate
void open() {
log.debug(this, SystemGdxLog.ACTIVATE);
File etcFile = new File(warpBase.getWarpshipHome(), "etc");
if (!etcFile.exists()) {
etcFile.mkdir();
}
File propFile = new File(warpBase.getWarpshipHome(), "etc/locale.xml");
if (propFile.exists()) {
try {
properties.loadFromXML(new FileInputStream(propFile));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
@Deactivate
void close() {
log.debug(this, SystemGdxLog.DEACTIVATE);
}
@Override
public void setTextLocaleI18n(String isoCode) {
properties.put(LocaleKey.TEXT_LOCALE.name(), isoCode);
save();
}
@Override
public String getTextLocaleI18n() {
return properties.getProperty(LocaleKey.TEXT_LOCALE.name(), "en");
}
@Override
public Locale getTextLocale() {
return new Locale(getTextLocaleI18n());
}
}

View file

@ -0,0 +1,113 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import org.osgi.framework.BundleContext;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpShip;
import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4Unicode4DService;
import love.distributedrebirth.unicode4d.CodePointᶻᴰ;
import love.distributedrebirth.unicode4d.atlas.FontAtlas;
import love.distributedrebirth.unicode4d.atlas.FontAtlasDriver;
import love.distributedrebirth.unicode4d.atlas.FontAtlasStore;
import love.distributedrebirth.unicode4d.atlas.FontAtlasStoreGlyph;
import love.distributedrebirth.unicode4d.draw.DrawCharacter;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class VrGem4Unicode4DServiceImpl implements VrGem4Unicode4DService {
//private final FontAtlas masterFontAtlas;
//private final Map<Integer, FontAtlasStoreGlyph> unicodeMap;
private final Map<Integer, DrawCharacter> unicodeCharMap;
public VrGem4Unicode4DServiceImpl() {
//masterFontAtlas = new FontAtlas();
//unicodeMap = new HashMap<>();
unicodeCharMap = new HashMap<>();
}
public void init(final BundleContext context, SystemWarpShip warpShip, Consumer<String> log) {
FontAtlas masterFontAtlas = new FontAtlas();
List<File> glyps = warpShip.searchMagic(context, "application/x-font-ttf4d");
try {
for (File glypSet:glyps) {
log.accept("Loading glypSet: "+glypSet);
FontAtlas atlas = FontAtlasDriver.newInstance().createReader().readFile(glypSet);
masterFontAtlas.setStores(atlas.getStores());
}
} catch (Exception e) {
e.printStackTrace();
log.accept("ERROR: "+e.getMessage());
}
log.accept("Master font atlas size: "+masterFontAtlas.getStores().size());
int dup = 0;
for (FontAtlasStore fontStore:masterFontAtlas.getStores()) {
log.accept("Map unicode: "+fontStore.getName()+" size: "+fontStore.getGlyphs().size());
for (FontAtlasStoreGlyph glyph: fontStore.getGlyphs()) {
int unicode = CodePointᶻᴰ.INSTANCE.searchUnicode(glyph.getTongs());
if (unicodeCharMap.containsKey(unicode)) {
dup++;
continue;
}
if (unicode > 0) {
//unicodeMap.put(unicode, glyph);
try {
unicodeCharMap.put(unicode, new DrawCharacter(glyph.getTongs()));
} catch (Exception e) {
e.printStackTrace();
log.accept("ERROR: "+e.getMessage());
}
}
}
}
log.accept("unicode map size: "+unicodeCharMap.size()+" dups: "+dup);
}
/*
@Override
public FontAtlas getFontAtlas() {
return masterFontAtlas;
}
@Override
public FontAtlasStoreGlyph getGlyphForUnicode(int unicode) {
return unicodeMap.get(unicode);
}
*/
@Override
public DrawCharacter getCharacterForUnicode(int unicode) {
return unicodeCharMap.get(unicode);
}
}

View file

@ -0,0 +1,202 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.PerspectiveCamera;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g3d.Environment;
import com.badlogic.gdx.graphics.g3d.ModelBatch;
import com.badlogic.gdx.graphics.g3d.ModelInstance;
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
import com.badlogic.gdx.graphics.g3d.environment.DirectionalLight;
import com.badlogic.gdx.graphics.g3d.utils.FirstPersonCameraController;
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.ScreenUtils;
import imgui.ImGui;
import imgui.flag.ImGuiCond;
import imgui.flag.ImGuiWindowFlags;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootArgs;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal;
import love.distributedrebirth.gdxapp4d.vrgem4.ImGuiSetup;
import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4DeskAppService;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppRenderer;
import love.distributedrebirth.gdxapp4d.vrgem4.view.DeskAppController;
import love.distributedrebirth.gdxapp4d.vrgem4.view.DeskAppSelectionListener;
import love.distributedrebirth.gdxapp4d.vrgem4.view.DeskAppInputProcessor;
import love.distributedrebirth.gdxapp4d.vrgem4.view.DeskTopScreen;
import love.distributedrebirth.gdxapp4d.vrgem4.view.DeskTopScreenMenu;
import love.distributedrebirth.unicode4d.draw.ImCharacter;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public abstract class AbstractScreenDesktop extends ScreenAdapter implements DeskTopScreen {
protected SpriteBatch batch;
protected BitmapFont font;
protected OrthographicCamera camera;
private final DeskTopScreenMenu screenMenu;
private final DeskAppController deskAppScreen;
private PerspectiveCamera cam;
private FirstPersonCameraController camController;
private DeskAppInputProcessor inputFilter;
private Environment environment;
private ModelBatch modelBatch;
private Array<ModelInstance> modelInstances = new Array<ModelInstance>();
public AbstractScreenDesktop(String name, SystemGdxBootArgs bootArgs, SystemGdxTerminal terminal, VrGem4DeskAppService deskAppService) {
this.create();
screenMenu = new DeskTopScreenMenu(bootArgs, terminal, deskAppService);
deskAppScreen = new DeskAppController(name);
deskAppScreen.addDeskAppListener(new DeskAppSelectionListener() {
@Override
public void selectDeskApp(DeskApp deskApp) {
if (deskApp == null) {
inputFilter.setFiltering(false);
} else {
inputFilter.setFiltering(true);
}
}
});
}
protected void createModel(ModelBuilder modelBuilder, Array<ModelInstance> modelInstances) {
}
private void create() {
batch = new SpriteBatch();
font = new BitmapFont();
camera = new OrthographicCamera();
camera.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
camera.update();
batch.setProjectionMatrix(camera.combined);
environment = new Environment();
environment.set(new ColorAttribute(ColorAttribute.AmbientLight, .4f, .4f, .4f, 1f));
environment.add(new DirectionalLight().set(1, 1, 1, -.2f, -.7f, -.1f));
modelBatch = new ModelBatch();
cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
cam.position.set(-20f, 30f, 0f);
cam.lookAt(0, 0, 0);
cam.near = 1f;
cam.far = 300f;
cam.update();
ModelBuilder modelBuilder = new ModelBuilder();
createModel(modelBuilder, modelInstances);
camController = new FirstPersonCameraController(cam);
//camController = new CameraInputController(cam);
inputFilter = new DeskAppInputProcessor(camController);
}
@Override
public final void show() {
Gdx.input.setInputProcessor(inputFilter);
showDesktop();
}
protected void showDesktop() {
}
@Override
public final void hide() {
Gdx.input.setInputProcessor(null);
hideDesktop();
}
protected void hideDesktop() {
}
@Override
public final void dispose() {
batch.dispose();
font.dispose();
modelBatch.dispose();
deskAppScreen.dispose();
disposeDesktop();
}
protected void disposeDesktop() {
}
@Override
public final void render(float delta) {
ScreenUtils.clear(0f, 0f, 0f, 1f, true);
ImGuiSetup.imGuiImp.newFrame();
ImGui.newFrame();
DeskTopScreen appScreen = this;
screenMenu.renderMenu(appScreen);
if (appScreen != null && appScreen.getDeskAppController().getCurrentDeskApp() != null) {
int sizeFlags = ImGuiCond.Always;
float sizeMenu = ImCharacter.HEIGHT+ImCharacter.MARGIN_MENUBAR;
ImGui.setNextWindowPos(0, sizeMenu, sizeFlags);
ImGui.setNextWindowSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight() - sizeMenu, sizeFlags);
int windowFlags = ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoTitleBar;
if (ImGui.begin(appScreen.getDeskAppController().getCurrentDeskApp().getContours().getTitle(), windowFlags)) {
DeskAppRenderer renderer = appScreen.getDeskAppController().getCurrentDeskApp().getContours().getContour(DeskAppContourSection.MAIN);
if (renderer != null) {
renderer.render();
}
}
ImGui.end();
}
camController.update();
renderDesktop(delta, modelBatch, cam, modelInstances);
ImGui.render();
ImGuiSetup.imGuiGlImp.renderDrawData(ImGui.getDrawData());
}
protected void renderDesktop(float delta, ModelBatch modelBatch, PerspectiveCamera cam, Array<ModelInstance> modelInstances) {
modelBatch.begin(cam);
for (ModelInstance instance : modelInstances) {
modelBatch.render(instance, environment);
}
modelBatch.end();
}
@Override
public DeskAppController getDeskAppController() {
return deskAppScreen;
}
}

View file

@ -0,0 +1,129 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.utils.ScreenUtils;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
abstract public class AbstractScrollScreen extends ScreenAdapter {
private static final int LINE_HEIGHT = 16;
private float scrollDeltaTime = 0f;
private String scrollText = "";
private int scrollIndex = 0;
private int scrollLine = LINE_HEIGHT;
private final Texture backgroundImage;
private final SystemGdxTerminal terminal;
protected SpriteBatch batch;
protected BitmapFont font;
public AbstractScrollScreen(SystemGdxTerminal terminal, String background) {
this.terminal = terminal;
batch = new SpriteBatch();
font = new BitmapFont();
backgroundImage = new Texture(Gdx.files.internal(background));
}
abstract protected String getScrollText();
abstract protected Class<? extends Screen> getNextScreen();
@Override
public final void render(float delta) {
ScreenUtils.clear(0f, 0f, 0f, 1f);
batch.begin();
batch.draw(backgroundImage, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
scrollDeltaTime += delta;
if (scrollDeltaTime > 0.04f) {
scrollDeltaTime = 0f;
scrollLine++;
if (scrollLine > LINE_HEIGHT && scrollIndex != -1) {
scrollIndex = getScrollText().indexOf("\n", scrollIndex+1);
if (scrollIndex > 0) {
scrollText = getScrollText().substring(0, scrollIndex);
scrollLine = 0;
}
}
}
int drawLine = 0;
String[] lines = scrollText.split("\n");
for (int i=lines.length;i>0;i--) {
String line = lines[i-1];
font.draw(batch, line, 100, scrollLine + (drawLine*LINE_HEIGHT));
drawLine++;
}
batch.end();
if (scrollText.length() >= 33) {
if (scrollLine >=Gdx.graphics.getHeight() || Gdx.input.isTouched() || Gdx.input.isKeyPressed(Keys.ENTER) || Gdx.input.isKeyPressed(Keys.SPACE)) {
terminal.selectScreen(getNextScreen());
}
}
}
@Override
public final void show() {
showScroll();
}
protected void showScroll() {
}
@Override
public final void hide() {
scrollText = "";
scrollIndex = 0;
scrollLine = LINE_HEIGHT;
hideScroll();
}
protected void hideScroll() {
}
@Override
public final void dispose() {
batch.dispose();
font.dispose();
backgroundImage.dispose();
disposeScroll();
}
protected void disposeScroll() {
}
}

View file

@ -0,0 +1,320 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Screen;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class ScreenCredits extends AbstractScrollScreen {
private final String creditsText = String.join("\n",
"Bunnies",
"Bunnies have",
"Bunnies have easter",
"Bunnies have easter egg",
"Bunnies have easter egg children",
"Bunnies have easter egg children with",
"Bunnies have easter egg children with many",
"Bunnies have easter egg children with many colored",
"Bunnies have easter egg children with many colored seed",
"Bunnies have easter egg children with many colored seed spots",
"...",
" ",
"=== BEGIN KJV PAGE ONE ===",
" ",
"### Genesis 1",
" ",
"1 In the beginning God created the heaven and the earth.",
" ",
"2 And the earth was without form,",
" and void;",
" and darkness was upon the face of the deep.",
" And the Spirit of God moved upon the face of the waters.",
" ",
"3 And God said, Let there be light: and there was light.",
" ",
"4 And God saw the light, that it was good:",
" and God divided the light from the darkness.",
" ",
"5 And God called the light Day, and the darkness he called Night.",
" And the evening and the morning were the first day.",
" ",
"6 And God said, Let there be a firmament in the midst of the waters,",
" and let it divide the waters from the waters.",
" ",
"7 And God made the firmament, and divided the waters which were under",
" the firmament from the waters which were above the firmament:",
" and it was so.",
" ",
"8 And God called the firmament Heaven.",
" And the evening and the morning were the second day.",
" ",
"9 And God said, Let the waters under the heaven be gathered together unto one place,",
" and let the dry land appear: and it was so.",
" ",
"10 And God called the dry land Earth; and the gathering together",
" of the waters called he Seas: and God saw that it was good.",
" ",
"11 And God said, Let the earth bring forth grass, the herb yielding seed,",
" and the fruit tree yielding fruit after his kind, whose seed is in itself, upon the earth:",
" and it was so.",
" ",
"12 And the earth brought forth grass, and herb yielding seed after his kind,",
" and the tree yielding fruit, whose seed was in itself, after his kind:",
" and God saw that it was good.",
" ",
"13 And the evening and the morning were the third day.",
" ",
"14 And God said, Let there be lights in the firmament of the heaven to divide the day from the night;",
" and let them be for signs, and for seasons, and for days, and years:",
" ",
"15 And let them be for lights in the firmament of the heaven to give light upon the earth: and it was so.",
" ",
"16 And God made two great lights; the greater light to rule the day,",
" and the lesser light to rule the night: he made the stars also.",
" ",
"17 And God set them in the firmament of the heaven to give light upon the earth,",
" ",
"18 And to rule over the day and over the night, and to divide the light from the darkness:",
" and God saw that it was good.",
" ",
"19 And the evening and the morning were the fourth day.",
" ",
"20 And God said, Let the waters bring forth abundantly the moving creature that hath life,",
" and fowl that may fly above the earth in the open firmament of heaven.",
" ",
"21 And God created great whales, and every living creature that moveth, which the waters brought forth abundantly,",
" after their kind, and every winged fowl after his kind: and God saw that it was good.",
" ",
"22 And God blessed them, saying, Be fruitful, and multiply, and fill the waters in the seas,",
" and let fowl multiply in the earth.",
" ",
"23 And the evening and the morning were the fifth day.",
" ",
"24 And God said, Let the earth bring forth the living creature after his kind, cattle,",
" and creeping thing, and beast of the earth after his kind: and it was so.",
" ",
"25 And God made the beast of the earth after his kind, and cattle after their kind,",
" and every thing that creepeth upon the earth after his kind: and God saw that it was good.",
" ",
"26 And God said, Let us make man in our image, after our likeness: and let them have dominion over the fish of the sea,",
" and over the fowl of the air, and over the cattle, and over all the earth,",
" and over every creeping thing that creepeth upon the earth.",
" ",
"27 So God created man in his own image, in the image of God created he him; male and female created he them.",
" ",
"28 And God blessed them, and God said unto them, Be fruitful, and multiply, and replenish the earth, and subdue it:",
" and have dominion over the fish of the sea, and over the fowl of the air,",
" and over every living thing that moveth upon the earth.",
" ",
"29 And God said, Behold, I have given you every herb bearing seed, which is upon the face of all the earth,",
" and every tree, in the which is the fruit of a tree yielding seed; to you it shall be for meat.",
" ",
"30 And to every beast of the earth, and to every fowl of the air, and to every thing that creepeth upon the earth,",
" wherein there is life, I have given every green herb for meat: and it was so.",
" ",
"31 And God saw every thing that he had made, and, behold, it was very good.",
" And the evening and the morning were the sixth day.",
" ",
"### Genesis 2",
" ",
"1 Thus the heavens and the earth were finished, and all the host of them.",
" ",
"2 And on the seventh day God ended his work which he had made;",
" and he rested on the seventh day from all his work which he had made.",
" ",
"3 And God blessed the seventh day, and sanctified it:",
" because that in it he had rested from all his work which God created and made.",
" ",
"4 These are the generations of the heavens and of the earth when they were created,",
" in the day that the LORD God made the earth and the heavens,",
" ",
"5 And every plant of the field before it was in the earth, and every herb of the field before it grew:",
" for the LORD God had not caused it to rain upon the earth, and there was not a man to till the ground.",
" ",
"6 But there went up a mist from the earth, and watered the whole face of the ground.",
" ",
"7 And the LORD God formed man of the dust of the ground, and breathed into his nostrils the breath of life;",
" and man became a living soul.",
" ",
"8 And the LORD God planted a garden eastward in Eden; and there he put the man whom he had formed.",
" ",
"9 And out of the ground made the LORD God to grow every tree that is pleasant to the sight, and good for food;",
" the tree of life also in the midst of the garden, and the tree of knowledge of good and evil.",
" ",
"10 And a river went out of Eden to water the garden; and from thence it was parted, and became into four heads.",
" ",
"11 The name of the first is Pison: that is it which compasseth the whole land of Havilah, where there is gold;",
" ",
"12 And the gold of that land is good: there is bdellium and the onyx stone.",
" ",
"13 And the name of the second river is Gihon: the same is it that compasseth the whole land of Ethiopia.",
" ",
"14 And the name of the third river is Hiddekel: that is it which goeth toward the east of Assyria.",
" And the fourth river is Euphrates.",
" ",
"15 And the LORD God took the man, and put him into the garden of Eden to dress it and to keep it.",
" ",
"16 And the LORD God commanded the man, saying, Of every tree of the garden thou mayest freely eat:",
" ",
"17 But of the tree of the knowledge of good and evil, thou shalt not eat of it:",
" for in the day that thou eatest thereof thou shalt surely die.",
" ",
"18 And the LORD God said, It is not good that the man should be alone; I will make him an help meet for him.",
" ",
"19 And out of the ground the LORD God formed every beast of the field, and every fowl of the air;",
" and brought them unto Adam to see what he would call them: and whatsoever Adam called every living creature,",
" that was the name thereof.",
" ",
"20 And Adam gave names to all cattle, and to the fowl of the air, and to every beast of the field;",
" but for Adam there was not found an help meet for him.",
" ",
"21 And the LORD God caused a deep sleep to fall upon Adam, and he slept: and he took one of his ribs,",
" and closed up the flesh instead thereof;",
" ",
"22 And the rib, which the LORD God had taken from man, made he a woman, and brought her unto the man.",
" ",
"23 And Adam said, This is now bone of my bones, and flesh of my flesh: she shall be called Woman,",
" because she was taken out of Man.",
" ",
"24 Therefore shall a man leave his father and his mother, and shall cleave unto his wife: and they shall be one flesh.",
" ",
"25 And they were both naked, the man and his wife, and were not ashamed.",
" ",
"### Genesis 3",
" ",
"1 Now the serpent was more subtil than any beast of the field which the LORD God had made.",
" And he said unto the woman, Yea, hath God said, Ye shall not eat of every tree of the garden?",
" ",
"2 And the woman said unto the serpent, We may eat of the fruit of the trees of the garden:",
" ",
"3 But of the fruit of the tree which is in the midst of the garden, God hath said,",
" Ye shall not eat of it, neither shall ye touch it, lest ye die.",
" ",
"4 And the serpent said unto the woman, Ye shall not surely die:",
" ",
"5 For God doth know that in the day ye eat thereof, then your eyes shall be opened,",
" and ye shall be as gods, knowing good and evil.",
" ",
"6 And when the woman saw that the tree was good for food, and that it was pleasant to the eyes,",
" and a tree to be desired to make one wise, she took of the fruit thereof, and did eat,",
" and gave also unto her husband with her; and he did eat.",
" ",
"7 And the eyes of them both were opened, and they knew that they were naked;",
" and they sewed fig leaves together, and made themselves aprons.",
" ",
"8 And they heard the voice of the LORD God walking in the garden in the cool of the day:",
" and Adam and his wife hid themselves from the presence of the LORD God amongst the trees of the garden.",
" ",
"9 And the LORD God called unto Adam, and said unto him, Where art thou?",
" ",
"10 And he said, I heard thy voice in the garden, and I was afraid, because I was naked; and I hid myself.",
" ",
"11 And he said, Who told thee that thou wast naked? Hast thou eaten of the tree,",
" whereof I commanded thee that thou shouldest not eat?",
" ",
"12 And the man said, The woman whom thou gavest to be with me, she gave me of the tree, and I did eat.",
" ",
"13 And the LORD God said unto the woman, What is this that thou hast done? And the woman said,",
" The serpent beguiled me, and I did eat.",
" ",
"14 And the LORD God said unto the serpent, Because thou hast done this, thou art cursed above all cattle,",
" and above every beast of the field; upon thy belly shalt thou go, and dust shalt thou eat all the days of thy life:",
" ",
"15 And I will put enmity between thee and the woman, and between thy seed and her seed;",
" it shall bruise thy head, and thou shalt bruise his heel.",
" ",
"16 Unto the woman he said, I will greatly multiply thy sorrow and thy conception; in sorrow thou shalt bring forth children;",
" and thy desire shall be to thy husband, and he shall rule over thee.",
" ",
"17 And unto Adam he said, Because thou hast hearkened unto the voice of thy wife, and hast eaten of the tree,",
" of which I commanded thee, saying, Thou shalt not eat of it: cursed is the ground for thy sake;",
" in sorrow shalt thou eat of it all the days of thy life;",
" ",
"18 Thorns also and thistles shall it bring forth to thee; and thou shalt eat the herb of the field;",
" ",
"19 In the sweat of thy face shalt thou eat bread, till thou return unto the ground; for out of it wast thou taken:",
" for dust thou art, and unto dust shalt thou return.",
" ",
"20 And Adam called his wife's name Eve; because she was the mother of all living.",
" ",
"21 Unto Adam also and to his wife did the LORD God make coats of skins, and clothed them.",
" ",
"22 And the LORD God said, Behold, the man is become as one of us, to know good and evil: and now,",
" lest he put forth his hand, and take also of the tree of life, and eat, and live for ever:",
" ",
"23 Therefore the LORD God sent him forth from the garden of Eden, to till the ground from whence he was taken.",
" ",
"24 So he drove out the man; and he placed at the east of the garden of Eden Cherubims,",
" and a flaming sword which turned every way, to keep the way of the tree of life.",
" ",
"### Genesis 4",
" ",
"1 And Adam knew Eve his wife; and she conceived, and bare Cain, and said, I have gotten a man from the LORD.",
" ",
"2 And she again bare his brother Abel. And Abel was a keeper of sheep, but Cain was a tiller of the ground.",
" ",
"3 And in process of time it came to pass, that Cain brought of the fruit of the ground an offering unto the LORD.",
" ",
"4 And Abel, he also brought of the firstlings of his flock and of the fat thereof.",
" And the LORD had respect unto Abel and to his offering:",
" ",
"5 But unto Cain and to his offering he had not respect. And Cain was very wroth, and his countenance fell.",
" ",
"=== BEGIN KJV PAGE ONE ===",
" ",
"Page two requires consent for marriage.",
" "
);
public ScreenCredits(SystemGdxTerminal terminal) {
super(terminal, "background/doom-credits.png");
}
@Override
protected String getScrollText() {
return creditsText;
}
@Override
protected Class<? extends Screen> getNextScreen() {
return ScreenDesktop1.class;
}
@Override
public void showScroll() {
//GDXAppVrGem4.INSTANCE.music.play(MusicSongType.CREDITS);
}
@Override
public void hideScroll() {
//GDXAppVrGem4.INSTANCE.music.play(MusicSongType.BACKGROUND);
}
}

View file

@ -0,0 +1,151 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.VertexAttributes;
import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.Model;
import com.badlogic.gdx.graphics.g3d.ModelInstance;
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
import com.badlogic.gdx.graphics.g3d.attributes.TextureAttribute;
import com.badlogic.gdx.graphics.g3d.utils.MeshPartBuilder;
import com.badlogic.gdx.graphics.g3d.utils.MeshPartBuilder.VertexInfo;
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.utils.Array;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootArgs;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal;
import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4DeskAppService;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class ScreenDesktop1 extends AbstractScreenDesktop {
private Texture backgroundImage;
private Model background;
private Model grid;
private Texture pyramidImage;
private Model pyramid1;
private Model pyramid1_1;
private Model pyramid1_2;
private Model pyramid1_3;
private Model pyramid2;
private Model pyramid3;
private Model pyramid3_1;
private Model pyramid3_2;
private Model pyramid3_3;
public ScreenDesktop1(SystemGdxBootArgs bootArgs, SystemGdxTerminal terminal, VrGem4DeskAppService deskAppService) {
super("Desktop1", bootArgs, terminal, deskAppService);
}
protected void createModel(ModelBuilder modelBuilder, Array<ModelInstance> modelInstances) {
backgroundImage = new Texture(Gdx.files.internal("background/temple-os.png"));
int attr = VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal | VertexAttributes.Usage.TextureCoordinates;
Material materialBackground = new Material(TextureAttribute.createDiffuse(backgroundImage));
modelBuilder.begin();
MeshPartBuilder mpb = modelBuilder.part("floor", GL20.GL_TRIANGLES, attr, materialBackground);
mpb.rect(-20f,-1f,-20f, -20f,-1f,20f, 20f,-1f,20f, 20f,-1f,-20f, 0,1,0);
background = modelBuilder.end();
pyramidImage = new Texture(Gdx.files.internal("background/amalia-kiss-reflex.png"));
//Material material2 = new Material(ColorAttribute.createDiffuse(.2f,.2f,.7f,1f));
Material material = new Material(TextureAttribute.createDiffuse(pyramidImage));
pyramid1 = buildPyramid(modelBuilder, attr, material, "pyramid1", 2.3f, 2.92f);
pyramid2 = buildPyramid(modelBuilder, attr, material, "pyramid2", 2.16f, 2.86f);
pyramid3 = buildPyramid(modelBuilder, attr, material, "pyramid3", 1.09f, 1.33f);
pyramid1_1 = buildPyramid(modelBuilder, attr, material, "pyramid1_1", 0.36f, 0.5f);
pyramid1_2 = buildPyramid(modelBuilder, attr, material, "pyramid1_2", 0.36f, 0.5f);
pyramid1_3 = buildPyramid(modelBuilder, attr, material, "pyramid1_3", 0.36f, 0.5f);
pyramid3_1 = buildPyramid(modelBuilder, attr, material, "pyramid3_1", 0.36f, 0.5f);
pyramid3_2 = buildPyramid(modelBuilder, attr, material, "pyramid3_2", 0.36f, 0.5f);
pyramid3_3 = buildPyramid(modelBuilder, attr, material, "pyramid3_3", 0.36f, 0.5f);
grid = modelBuilder.createLineGrid(33, 33, 1f, 1f, new Material(ColorAttribute.createDiffuse(.2f,.2f,.2f,1f)), VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal);
modelInstances.add(new ModelInstance(background, 0, 0, 0));
modelInstances.add(new ModelInstance(grid, 0, 0, 0));
modelInstances.add(new ModelInstance(pyramid1, -2, 0, 12));
modelInstances.add(new ModelInstance(pyramid2, -8, 0, 6));
modelInstances.add(new ModelInstance(pyramid3, -14, 0, 2));
modelInstances.add(new ModelInstance(pyramid1_1, -3, 0, 15.5f));
modelInstances.add(new ModelInstance(pyramid1_2, -4, 0, 15.5f));
modelInstances.add(new ModelInstance(pyramid1_3, -5, 0, 15.5f));
modelInstances.add(new ModelInstance(pyramid3_1, -16.5f, 0, 0));
modelInstances.add(new ModelInstance(pyramid3_2, -16.5f, 0, 1));
modelInstances.add(new ModelInstance(pyramid3_3, -16.5f, 0, 2));
}
private Model buildPyramid(ModelBuilder modelBuilder,int attr, Material material, String name, float width, float height) {
Vector3 normal = new Vector3(1,1,1);
VertexInfo v1 = new VertexInfo();
VertexInfo v2 = new VertexInfo();
VertexInfo v3 = new VertexInfo();
modelBuilder.begin();
MeshPartBuilder mpb = modelBuilder.part(name, GL20.GL_TRIANGLES, attr, material);
v1.set(new Vector3(-width,0, width), normal, null, new Vector2(1,1));
v2.set(new Vector3(width,0, width), normal, null, new Vector2(0,.6f));
v3.set(new Vector3(0, height, 0), normal, null, new Vector2(1,0));
mpb.triangle(v1, v2, v3);
v1.set(new Vector3(width,0, width), normal, null, new Vector2(1,1));
v2.set(new Vector3(width,0, -width), normal, null, new Vector2(0,.6f));
v3.set(new Vector3(0, height, 0), normal, null, new Vector2(1,0));
mpb.triangle(v1, v2, v3);
v1.set(new Vector3(width,0, -width), normal, null, new Vector2(1,1));
v2.set(new Vector3(-width,0, -width), normal, null, new Vector2(0,.6f));
v3.set(new Vector3(0, height, 0), normal, null, new Vector2(1,0));
mpb.triangle(v1, v2, v3);
v1.set(new Vector3(-width,0, -width), normal, null, new Vector2(1,1));
v2.set(new Vector3(-width,0, width), normal, null, new Vector2(0,.6f));
v3.set(new Vector3(0, height, 0), normal, null, new Vector2(1,0));
mpb.triangle(v1, v2, v3);
return modelBuilder.end();
}
@Override
protected void disposeDesktop() {
backgroundImage.dispose();
background.dispose();
pyramidImage.dispose();
pyramid1.dispose();
pyramid2.dispose();
pyramid3.dispose();
pyramid1_1.dispose();
pyramid1_2.dispose();
pyramid1_3.dispose();
pyramid3_1.dispose();
pyramid3_2.dispose();
pyramid3_3.dispose();
grid.dispose();
}
}

View file

@ -0,0 +1,77 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.VertexAttributes;
import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.Model;
import com.badlogic.gdx.graphics.g3d.ModelInstance;
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
import com.badlogic.gdx.graphics.g3d.attributes.TextureAttribute;
import com.badlogic.gdx.graphics.g3d.utils.MeshPartBuilder;
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.utils.Array;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootArgs;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal;
import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4DeskAppService;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class ScreenDesktop2 extends AbstractScreenDesktop {
private Texture backgroundImage;
private Model background;
private Model grid;
public ScreenDesktop2(SystemGdxBootArgs bootArgs, SystemGdxTerminal terminal, VrGem4DeskAppService deskAppService) {
super("Desktop2", bootArgs, terminal, deskAppService);
}
protected void createModel(ModelBuilder modelBuilder, Array<ModelInstance> modelInstances) {
backgroundImage = new Texture(Gdx.files.internal("background/terrydavis-front.png"));
int attr = VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal | VertexAttributes.Usage.TextureCoordinates;
Material material = new Material(TextureAttribute.createDiffuse(backgroundImage));
modelBuilder.begin();
MeshPartBuilder mpb = modelBuilder.part("floor", GL20.GL_TRIANGLES, attr, material);
mpb.rect(-20f,-1f,-20f, -20f,-1f,20f, 20f,-1f,20f, 20f,-1f,-20f, 0,1,0);
background = modelBuilder.end();
grid = modelBuilder.createLineGrid(33, 33, 1f, 1f, new Material(ColorAttribute.createDiffuse(.1f,.1f,.1f,1f)), VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal);
modelInstances.add(new ModelInstance(background, 0, 0, 0));
modelInstances.add(new ModelInstance(grid, 0, 0, 0));
}
@Override
protected void disposeDesktop() {
backgroundImage.dispose();
background.dispose();
grid.dispose();
}
}

View file

@ -0,0 +1,77 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.VertexAttributes;
import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.Model;
import com.badlogic.gdx.graphics.g3d.ModelInstance;
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
import com.badlogic.gdx.graphics.g3d.attributes.TextureAttribute;
import com.badlogic.gdx.graphics.g3d.utils.MeshPartBuilder;
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.utils.Array;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootArgs;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal;
import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4DeskAppService;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class ScreenDesktop3 extends AbstractScreenDesktop {
private Texture backgroundImage;
private Model background;
private Model grid;
public ScreenDesktop3(SystemGdxBootArgs bootArgs, SystemGdxTerminal terminal, VrGem4DeskAppService deskAppService) {
super("Desktop3", bootArgs, terminal, deskAppService);
}
protected void createModel(ModelBuilder modelBuilder, Array<ModelInstance> modelInstances) {
backgroundImage = new Texture(Gdx.files.internal("background/terrydavis-nose.png"));
int attr = VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal | VertexAttributes.Usage.TextureCoordinates;
Material material = new Material(TextureAttribute.createDiffuse(backgroundImage));
modelBuilder.begin();
MeshPartBuilder mpb = modelBuilder.part("floor", GL20.GL_TRIANGLES, attr, material);
mpb.rect(-20f,-1f,-20f, -20f,-1f,20f, 20f,-1f,20f, 20f,-1f,-20f, 0,1,0);
background = modelBuilder.end();
grid = modelBuilder.createLineGrid(33, 33, 1f, 1f, new Material(ColorAttribute.createDiffuse(.1f,.1f,.1f,1f)), VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal);
modelInstances.add(new ModelInstance(background, 0, 0, 0));
modelInstances.add(new ModelInstance(grid, 0, 0, 0));
}
@Override
protected void disposeDesktop() {
backgroundImage.dispose();
background.dispose();
grid.dispose();
}
}

View file

@ -0,0 +1,218 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.PerspectiveCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.VertexAttributes;
import com.badlogic.gdx.graphics.VertexAttributes.Usage;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.BitmapFontCache;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.Model;
import com.badlogic.gdx.graphics.g3d.ModelBatch;
import com.badlogic.gdx.graphics.g3d.ModelInstance;
import com.badlogic.gdx.graphics.g3d.Shader;
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
import com.badlogic.gdx.graphics.g3d.attributes.TextureAttribute;
import com.badlogic.gdx.graphics.g3d.utils.MeshPartBuilder;
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.utils.Align;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.viewport.ScreenViewport;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootArgs;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal;
import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4DeskAppService;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class ScreenDesktop4 extends AbstractScreenDesktop {
private final Shader shader;
private final BitmapFont font;
private final BitmapFontCache fontCache;
private final ScreenViewport uiViewport = new ScreenViewport();
private final SpriteBatch spriteBatch;
private final Vector3 textPosition = new Vector3(6.5f, 10.5f, 5.5f);
private Model grid;
private Model model;
private float colorDeltaTime = 0f;
private float colorFade = 0f;
private boolean colorPositive = true;
private Texture backgroundImage;
private Model background;
public ScreenDesktop4(SystemGdxBootArgs bootArgs, SystemGdxTerminal terminal, VrGem4DeskAppService deskAppService) {
super("Desktop4", bootArgs, terminal, deskAppService);
shader = new UserColorShader();
shader.init();
font = new BitmapFont();
fontCache = new BitmapFontCache(font, false);
spriteBatch = new SpriteBatch();
}
protected void createModel(ModelBuilder modelBuilder, Array<ModelInstance> modelInstances) {
backgroundImage = new Texture(Gdx.files.internal("background/map-africa-sambuyu.png"));
int attr = VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal | VertexAttributes.Usage.TextureCoordinates;
Material material = new Material(TextureAttribute.createDiffuse(backgroundImage));
modelBuilder.begin();
MeshPartBuilder mpb = modelBuilder.part("floor", GL20.GL_TRIANGLES, attr, material);
mpb.rect(-20f,-1f,-20f, -20f,-1f,20f, 20f,-1f,20f, 20f,-1f,-20f, 0,1,0);
background = modelBuilder.end();
model = modelBuilder.createBox(.3f, .3f, .3f,new Material(ColorAttribute.createDiffuse(.1f,.1f,.1f,0f)), Usage.Position | Usage.Normal);
for (int x = -4; x < 6; x++) {
for (int y = 1; y < 11; y++) {
for (int z = -4; z < 7; z++) {
modelInstances.add(new ModelInstance(model, x, y, z));
}
}
}
grid = modelBuilder.createLineGrid(33, 33, 1f, 1f, new Material(ColorAttribute.createDiffuse(.2f,.2f,.2f,1f)), Usage.Position | Usage.Normal);
modelInstances.add(new ModelInstance(grid, 0, 0, 0));
modelInstances.add(new ModelInstance(background, 0, 0, 0));
}
@Override
protected void disposeDesktop() {
backgroundImage.dispose();
background.dispose();
grid.dispose();
model.dispose();
}
protected void renderDesktop(float delta, ModelBatch modelBatch, PerspectiveCamera cam, Array<ModelInstance> modelInstances) {
colorFade(delta, modelInstances);
modelBatch.begin(cam);
for (ModelInstance instance : modelInstances) {
modelBatch.render(instance, shader);
}
modelBatch.end();
// Multiply vector with world-space position with 3D projection-view matrix
final Vector3 clipSpacePos = new Vector3(textPosition);
final float w = multiplyProjective(cam.combined, clipSpacePos, 1f);
// Do not render the text if it is behind the camera or too far away
if (clipSpacePos.z >= -1f && clipSpacePos.z <= 1f) {
// Calculate the position on screen (clip space is [-1,1], we need [-size/2, size/2], but this depends on your viewport)
final float textPosX = clipSpacePos.x * Gdx.graphics.getWidth() * 0.5f;
final float textPosY = clipSpacePos.y * Gdx.graphics.getHeight() * 0.5f;
// Set the text normally. The position must be 0, otherwise the scaling won't work.
// If you don't want perspective scaling, you can set x,y to textPosX,textPosY directly and skip the next part.
fontCache.setText("Now in 3D", 0f, 0, 0f, Align.center, false);
// Size of the text in the world
final float fontSize = 5f;
// Scaling factor
final float fontScale = fontSize / w;
// Go through prepared vertices of the font cache and do necessary transformation
final int regionCount = font.getRegions().size;
for (int page = 0; page < regionCount; page++) {
final int vertexCount = fontCache.getVertexCount(page);
final float[] vertices = fontCache.getVertices(page);
for (int v = 0; v < vertexCount; v += 5) {
// This is why the text position must be 0 - otherwise the scaling would move the text
vertices[v] = vertices[v] * fontScale + textPosX;
vertices[v + 1] = vertices[v + 1] * fontScale + textPosY;
}
}
// Standard viewport update
uiViewport.update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true);
spriteBatch.setProjectionMatrix(uiViewport.getCamera().projection);
// Draw the text normally
spriteBatch.begin();
fontCache.draw(spriteBatch);
spriteBatch.end();
}
}
/**
* Multiply 4x4 matrix {@code m} and 4D vector {$code (v, vW)} together.
* Store result {@code (x/w, y/w, z/w)} back in {@code v} and return {@code w}.
*/
private static float multiplyProjective(Matrix4 m, Vector3 v, float vW) {
final float[] mat = m.val;
final float x = v.x * mat[Matrix4.M00] + v.y * mat[Matrix4.M01] + v.z * mat[Matrix4.M02] + vW * mat[Matrix4.M03];
final float y = v.x * mat[Matrix4.M10] + v.y * mat[Matrix4.M11] + v.z * mat[Matrix4.M12] + vW * mat[Matrix4.M13];
final float z = v.x * mat[Matrix4.M20] + v.y * mat[Matrix4.M21] + v.z * mat[Matrix4.M22] + vW * mat[Matrix4.M23];
final float w = v.x * mat[Matrix4.M30] + v.y * mat[Matrix4.M31] + v.z * mat[Matrix4.M32] + vW * mat[Matrix4.M33];
final float iw = 1f / w;
v.set(x * iw, y * iw, z * iw);
return w;
}
private void colorFade(float delta, Array<ModelInstance> modelInstances) {
colorDeltaTime += delta;
if (colorDeltaTime > 0.04f) {
colorDeltaTime = 0f;
if (colorPositive) {
colorFade += delta;
} else {
colorFade -= delta;
}
if (colorFade > 1f) {
colorPositive = false;
} else if (colorFade < .5f) {
colorPositive = true;
}
}
int i=0;
for (int x = -4; x < 6; x++) {
for (int y = 1; y < 11; y++) {
for (int z = -4; z < 7; z++) {
float red = .1f;
float green = (y+2f)/10f*colorFade;
float blue = .1f;
if (x == 3 || y == 1 || z == -1) {
red = (y+2f)/10f*colorFade;
green = 0f;
}
if (x == -1 || y == 10 || z == 5) {
green = 0f;
blue = (y+2f)/10f*colorFade;
}
ModelInstance instance = modelInstances.get(i++);
ColorAttribute attr = ColorAttribute.createDiffuse(red, green, blue, 1f);
instance.materials.get(0).set(attr);
}
}
}
}
}

View file

@ -0,0 +1,98 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Screen;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class ScreenHelp extends AbstractScrollScreen {
private final String creditsText = String.join("\n",
"Genesis 11",
" ",
"1 And the whole earth was of one language, and of one speech.",
" ",
"2 And it came to pass, as they journeyed from the east,",
" that they found a plain in the land of Shinar;",
" and they dwelt there.",
" ",
"3 And they said one to another, Go to, let us make brick,",
" and burn them thoroughly. And they had brick for stone,",
" and slime had they for mortar.",
" ",
"4 And they said, Go to, let us build us a city, and a tower,",
" whose top may reach unto heaven; and let us make us a name,",
" lest we be scattered abroad upon the face of the whole earth.",
" ",
"5 And the LORD came down to see the city and the tower,",
" which the children of men builded.",
" ",
"6 And the LORD said, Behold, the people is one,",
" and they have all one language; and this they begin to do:",
" and now nothing will be restrained from them,",
" which they have imagined to do.",
" ",
"7 Go to, let us go down, and there confound their language,",
" that they may not understand one another's speech.",
" ",
"8 So the LORD scattered them abroad from thence upon the face",
" of all the earth: and they left off to build the city.",
" ",
"9 Therefore is the name of it called Babel; because the LORD",
" did there confound the language of all the earth: and from",
" thence did the LORD scatter them abroad upon",
" the face of all the earth.",
" "
);
public ScreenHelp(SystemGdxTerminal terminal) {
super(terminal, "background/terrydavis-nose.png");
}
@Override
protected String getScrollText() {
return creditsText;
}
@Override
protected Class<? extends Screen> getNextScreen() {
return ScreenDesktop1.class;
}
@Override
public void showScroll() {
//GDXAppVrGem4.INSTANCE.music.play(MusicSongType.INTRO);
}
@Override
public void hideScroll() {
//GDXAppVrGem4.INSTANCE.music.play(MusicSongType.BACKGROUND);
}
}

View file

@ -0,0 +1,101 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g3d.Renderable;
import com.badlogic.gdx.graphics.g3d.Shader;
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
import com.badlogic.gdx.graphics.g3d.utils.RenderContext;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
import com.badlogic.gdx.utils.GdxRuntimeException;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class UserColorShader implements Shader {
ShaderProgram program;
Camera camera;
RenderContext context;
int u_projTrans;
int u_worldTrans;
int u_color;
@Override
public void init () {
String vert = Gdx.files.internal("shader/color.vertex.glsl").readString();
String frag = Gdx.files.internal("shader/color.fragment.glsl").readString();
program = new ShaderProgram(vert, frag);
if (!program.isCompiled()) {
throw new GdxRuntimeException(program.getLog());
}
u_projTrans = program.getUniformLocation("u_projTrans");
u_worldTrans = program.getUniformLocation("u_worldTrans");
u_color = program.getUniformLocation("u_color");
}
@Override
public void dispose () {
program.dispose();
}
@Override
public void begin (Camera camera, RenderContext context) {
this.camera = camera;
this.context = context;
program.bind();
program.setUniformMatrix(u_projTrans, camera.combined);
context.setDepthTest(GL20.GL_LEQUAL);
context.setCullFace(GL20.GL_BACK);
}
@Override
public void render (Renderable renderable) {
program.setUniformMatrix(u_worldTrans, renderable.worldTransform);
Color color = ((ColorAttribute)renderable.material.get(ColorAttribute.Diffuse)).color;
program.setUniformf(u_color, color.r, color.g, color.b, color.a);
renderable.meshPart.render(program);
}
@Override
public void end () {
}
@Override
public int compareTo (Shader other) {
return 0;
}
@Override
public boolean canRender(Renderable renderable) {
return renderable.material.has(ColorAttribute.Diffuse);
}
}

View file

@ -0,0 +1,44 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.service;
import java.util.List;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppLauncher;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppMenuSection;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public interface VrGem4DeskAppService {
List<DeskAppLauncher> getMenuSection(DeskAppMenuSection section);
void installDeskApp(DeskAppLauncher launcher);
void removeDeskApp(DeskAppLauncher launcher);
}

View file

@ -0,0 +1,42 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.service;
import java.util.Locale;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public interface VrGem4LocaleService {
void setTextLocaleI18n(String isoCode);
String getTextLocaleI18n();
Locale getTextLocale();
}

View file

@ -0,0 +1,41 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.service;
import love.distributedrebirth.unicode4d.draw.DrawCharacter;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public interface VrGem4Unicode4DService {
//FontAtlas getFontAtlas();
//FontAtlasStoreGlyph getGlyphForUnicode(int unicode);
DrawCharacter getCharacterForUnicode(int unicode);
}

View file

@ -0,0 +1,57 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
abstract public class AbstractDeskApp implements DeskApp {
private final DeskAppContour contours;
public AbstractDeskApp() {
this.contours = new DeskAppContour();
}
@Override
public DeskAppContour getContours() {
return contours;
}
@Override
public void show() {
}
@Override
public void hide() {
}
@Override
public void exit() {
}
}

View file

@ -0,0 +1,44 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public interface DeskApp {
DeskAppContour getContours();
void create();
void show();
void hide();
void exit();
}

View file

@ -0,0 +1,60 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp;
import java.util.HashMap;
import java.util.Map;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class DeskAppContour {
private String title;
private final Map<DeskAppContourSection, DeskAppRenderer> renderers;
public DeskAppContour() {
this.renderers = new HashMap<>();
}
public void setTitle(String title) {
this.title = title;
}
public String getTitle() {
return title;
}
public void registrateContour(DeskAppContourSection section, DeskAppRenderer renderer) {
renderers.put(section, renderer);
}
public DeskAppRenderer getContour(DeskAppContourSection section) {
return renderers.get(section);
}
}

View file

@ -0,0 +1,54 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public enum DeskAppContourSection {
MAIN,
FILE_NEW,
FILE_CLOSE,
FILE_SAVE,
FILE_OPTION,
FILE_PRINT,
EDIT_UNDO,
EDIT_COPY,
EDIT_SELECT,
EDIT_FIND,
EDIT_OPTION,
SELF_WELCOME,
SELF_INDEX,
SELF_OPTION,
SELF_ABOUT,
;
}

View file

@ -0,0 +1,58 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp;
import java.util.function.Supplier;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public final class DeskAppLauncher {
private final DeskAppMenuSection menuSection;
private final String name;
private final Supplier<DeskApp> launcher;
public DeskAppLauncher(DeskAppMenuSection menuSection, String name, Supplier<DeskApp> launcher) {
this.menuSection = menuSection;
this.name = name;
this.launcher = launcher;
}
public DeskAppMenuSection getMenuSection() {
return menuSection;
}
public String getName() {
return name;
}
public Supplier<DeskApp> getLauncher() {
return launcher;
}
}

View file

@ -0,0 +1,51 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public enum DeskAppMenuSection {
EDITORS,
EDUCATION,
INTERNET,
MULTIMEDIA,
PROGRAMMING,
SCIENCE,
SHELLS,
SYSTEM,
;
private DeskAppMenuSection() {
}
public boolean isSystem() {
return this == SYSTEM;
}
}

View file

@ -0,0 +1,37 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@FunctionalInterface
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public interface DeskAppRenderer {
void render();
}

View file

@ -0,0 +1,116 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.view;
import java.util.ArrayList;
import java.util.List;
import imgui.ImGui;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppRenderer;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class DeskAppController {
private final String name;
private final List<DeskApp> deskApps;
private DeskApp currentDeskApp;
private final List<DeskAppSelectionListener> deskAppListeners;
public DeskAppController(String name) {
this.name = name;
this.deskApps = new ArrayList<>();
this.deskAppListeners = new ArrayList<>();
}
public String getName() {
return name;
}
public void addDeskApp(DeskApp deskApp) {
deskApps.add(deskApp);
setCurrentDeskApp(deskApp);
}
public void removeDeskApp(DeskApp deskApp) {
deskApps.remove(deskApp);
if (currentDeskApp == deskApp) {
setCurrentDeskApp(null);
}
}
public List<DeskApp> getDeskApps() {
return deskApps;
}
public DeskApp getCurrentDeskApp() {
return currentDeskApp;
}
public void setCurrentDeskApp(DeskApp currentDeskApp) {
this.currentDeskApp = currentDeskApp;
for (DeskAppSelectionListener listener: deskAppListeners) {
listener.selectDeskApp(currentDeskApp);
}
}
public void addDeskAppListener(DeskAppSelectionListener listener) {
deskAppListeners.add(listener);
}
public final void renderMenu() {
for (DeskApp app: deskApps) {
if (ImGui.menuItem(app.getContours().getTitle())) {
//selectScreen(....class);
}
}
}
public final void render(float delta) {
for (DeskApp app: deskApps) {
DeskAppRenderer appMain = app.getContours().getContour(DeskAppContourSection.MAIN);
if (appMain != null) {
appMain.render();
}
}
renderBackground();
}
protected void renderBackground() {
}
public final void dispose() {
for (DeskApp app : deskApps) {
app.exit();
}
deskApps.clear();
currentDeskApp = null;
}
}

View file

@ -0,0 +1,144 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.view;
import com.badlogic.gdx.InputProcessor;
import love.distributedrebirth.unicode4d.draw.ImCharacter;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class DeskAppInputProcessor implements InputProcessor {
private final InputProcessor input;
private boolean filtering = false;
public DeskAppInputProcessor(InputProcessor input) {
this.input = input;
}
public void setFiltering(boolean filtering) {
this.filtering = filtering;
}
public boolean isFiltering() {
return filtering;
}
private boolean isFilterMenu(int screenY) {
// font + margin top-bottom = 4px
if (screenY <= ImCharacter.HEIGHT+ImCharacter.MARGIN_MENUBAR) {
return true;
}
return false;
}
@Override
public boolean keyDown(int keycode) {
if (filtering) {
return false;
} else {
return input.keyDown(keycode);
}
}
@Override
public boolean keyUp(int keycode) {
if (filtering) {
return false;
} else {
return input.keyUp(keycode);
}
}
@Override
public boolean keyTyped(char character) {
if (filtering) {
return false;
} else {
return input.keyTyped(character);
}
}
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
if (isFilterMenu(screenY)) {
return false;
}
if (filtering) {
return false;
} else {
return input.touchDown(screenX, screenY, pointer, button);
}
}
@Override
public boolean touchUp(int screenX, int screenY, int pointer, int button) {
if (isFilterMenu(screenY)) {
return false;
}
if (filtering) {
return false;
} else {
return input.touchUp(screenX, screenY, pointer, button);
}
}
@Override
public boolean touchDragged(int screenX, int screenY, int pointer) {
if (isFilterMenu(screenY)) {
return false;
}
if (filtering) {
return false;
} else {
return input.touchDragged(screenX, screenY, pointer);
}
}
@Override
public boolean mouseMoved(int screenX, int screenY) {
if (isFilterMenu(screenY)) {
return false;
}
if (filtering) {
return false;
} else {
return input.mouseMoved(screenX, screenY);
}
}
@Override
public boolean scrolled(float amountX, float amountY) {
if (filtering) {
return false;
} else {
return input.scrolled(amountX, amountY);
}
}
}

View file

@ -0,0 +1,37 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.view;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskApp;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public interface DeskAppSelectionListener {
void selectDeskApp(DeskApp deskApp);
}

View file

@ -0,0 +1,38 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.view;
import com.badlogic.gdx.Screen;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public interface DeskTopScreen extends Screen {
DeskAppController getDeskAppController();
}

View file

@ -0,0 +1,339 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.gdxapp4d.vrgem4.view;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import com.badlogic.gdx.Gdx;
import imgui.ImGui;
import imgui.type.ImBoolean;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootArgs;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal;
import love.distributedrebirth.gdxapp4d.vrgem4.FontAwesomeIcons;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenCredits;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop1;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop2;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop3;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop4;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenHelp;
import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4DeskAppService;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppLauncher;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppMenuSection;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppRenderer;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᐪᓫᕽᐪ.ᓑᣕᣳᒼᐤᒄᓫ.BaseGlyphSet;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class DeskTopScreenMenu {
private final SystemGdxBootArgs bootArgs;
private final SystemGdxTerminal terminal;
private final VrGem4DeskAppService deskAppService;
private ImBoolean fileMinimizeSelected = new ImBoolean(false);
private ImBoolean fileCloseSelected = new ImBoolean(false);
private ImBoolean tosSelfSelected = new ImBoolean(false);
private DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
public DeskTopScreenMenu(SystemGdxBootArgs bootArgs, SystemGdxTerminal terminal, VrGem4DeskAppService deskAppService) {
this.bootArgs = bootArgs;
this.terminal = terminal;
this.deskAppService = deskAppService;
}
public void renderMenu(DeskTopScreen appScreen) {
DeskApp deskApp = appScreen.getDeskAppController().getCurrentDeskApp();
ImGui.beginMainMenuBar();
renderVRGEM4Menu(appScreen);
renderTOS4Menu(appScreen);
if (deskApp != null) {
renderEditMenu(deskApp);
renderFileMenu(deskApp);
renderSelfMenu(appScreen, deskApp);
}
renderStatusMenu();
ImGui.endMainMenuBar();
}
private void renderStatusMenu() {
float pushLeft = ImGui.getWindowWidth() - 250;
int labelId = "ImGui".hashCode();
while (ImGui.getCursorScreenPosX() < pushLeft) {
String labelNumber = BaseGlyphSet.WHITESPACE.BȍőnPrintNumber10(labelId);
if (ImGui.beginMenu(labelNumber, false)) { // ImGui label is ID so it must be unique else it won't display....silently
ImGui.endMenu();
}
labelId++;
}
String fps = BaseGlyphSet.LATIN_TOP.BȍőnPrintNumber10((int)ImGui.getIO().getFramerate());
if (ImGui.beginMenu(dateFormat.format(new Date())+"ᶠᵖˢ⁼"+fps, false)) {
ImGui.endMenu();
}
}
private void renderSelfMenu(DeskTopScreen appScreen, DeskApp deskApp) {
if (ImGui.beginMenu(deskApp.getContours().getTitle())) {
if (ImGui.menuItem(FontAwesomeIcons.FolderMinus + " Minimize", "", fileMinimizeSelected, deskApp != null )) {
fileMinimizeSelected.set(false);
if (deskApp != null) {
appScreen.getDeskAppController().setCurrentDeskApp(null);
}
}
if (ImGui.beginMenu(FontAwesomeIcons.WindowRestore + " Move")) {
if (ImGui.menuItem("Desktop1", "", false, !(appScreen instanceof ScreenDesktop1))) {
appScreen.getDeskAppController().removeDeskApp(deskApp);
terminal.selectScreen(ScreenDesktop1.class).getDeskAppController().addDeskApp(deskApp);
}
if (ImGui.menuItem("Desktop2", "", false, !(appScreen instanceof ScreenDesktop2))) {
appScreen.getDeskAppController().removeDeskApp(deskApp);
terminal.selectScreen(ScreenDesktop2.class).getDeskAppController().addDeskApp(deskApp);
}
if (ImGui.menuItem("Desktop3", "", false, !(appScreen instanceof ScreenDesktop3))) {
appScreen.getDeskAppController().removeDeskApp(deskApp);
terminal.selectScreen(ScreenDesktop3.class).getDeskAppController().addDeskApp(deskApp);
}
if (ImGui.menuItem("Desktop4", "", false, !(appScreen instanceof ScreenDesktop4))) {
appScreen.getDeskAppController().removeDeskApp(deskApp);
terminal.selectScreen(ScreenDesktop4.class).getDeskAppController().addDeskApp(deskApp);
}
ImGui.endMenu();
}
if (ImGui.menuItem(FontAwesomeIcons.WindowClose + " Exit", "", fileCloseSelected, deskApp != null)) {
fileCloseSelected.set(false);
if (deskApp != null) {
deskApp.exit();
appScreen.getDeskAppController().removeDeskApp(deskApp);
appScreen.getDeskAppController().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(FontAwesomeIcons.File + " 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 renderTOS4Menu(DeskTopScreen appScreen) {
if (ImGui.beginMenu("" + " TOS⁴")) {
if (ImGui.menuItem(FontAwesomeIcons.Camera + " Main reality", "", tosSelfSelected, appScreen.getDeskAppController().getCurrentDeskApp() != null)) {
appScreen.getDeskAppController().getCurrentDeskApp().hide();
appScreen.getDeskAppController().setCurrentDeskApp(null);
tosSelfSelected.set(false);
}
for (DeskApp app: appScreen.getDeskAppController().getDeskApps()) {
boolean enabled = true;
if (appScreen.getDeskAppController().getCurrentDeskApp() == app) {
enabled = false;
}
if (ImGui.menuItem(app.getContours().getTitle(), "", tosSelfSelected, enabled)) {
app.show();
appScreen.getDeskAppController().setCurrentDeskApp(app);
tosSelfSelected.set(false);
}
}
ImGui.endMenu();
}
}
private void renderVRGEM4Menu(DeskTopScreen appScreen) {
if (ImGui.beginMenu("" + " vrGEM⁴")) {
String infix1 = "";
String infix2 = "";
String infix3 = "";
String infix4 = "";
if (appScreen instanceof ScreenDesktop1) {
infix1 = FontAwesomeIcons.Eye + " ";
}
if (appScreen instanceof ScreenDesktop2) {
infix2 = FontAwesomeIcons.Eye + " ";
}
if (appScreen instanceof ScreenDesktop3) {
infix3 = FontAwesomeIcons.Eye + " ";
}
if (appScreen instanceof ScreenDesktop4) {
infix4 = FontAwesomeIcons.Eye + " ";
}
if (ImGui.menuItem(infix1+"Desktop1")) {
terminal.selectScreen(ScreenDesktop1.class);
}
if (ImGui.menuItem(infix2+"Desktop2")) {
terminal.selectScreen(ScreenDesktop2.class);
}
if (ImGui.menuItem(infix3+"Desktop3")) {
terminal.selectScreen(ScreenDesktop3.class);
}
if (ImGui.menuItem(infix4+"Desktop4")) {
terminal.selectScreen(ScreenDesktop4.class);
}
ImGui.separator();
if (ImGui.beginMenu(FontAwesomeIcons.PlusSquare + " Start App")) {
for (DeskAppMenuSection section: DeskAppMenuSection.values()) {
if (section.isSystem()) {
continue;
}
List<DeskAppLauncher> menu = deskAppService.getMenuSection(section);
if (menu.isEmpty()) {
continue;
}
if (ImGui.beginMenu(section.name())) {
for (DeskAppLauncher launcher: menu) {
if (ImGui.menuItem(launcher.getName())) {
DeskApp controller = launcher.getLauncher().get();
controller.create();
appScreen.getDeskAppController().addDeskApp(controller);
}
}
ImGui.endMenu();
}
}
ImGui.endMenu();
}
if (ImGui.menuItem(FontAwesomeIcons.Terminal + " Run App")) {
}
ImGui.separator();
if (Gdx.graphics.isFullscreen()) {
if (ImGui.menuItem(FontAwesomeIcons.Wheelchair + " Window Mode")) {
Gdx.graphics.setWindowedMode(bootArgs.getWindowWidth(), bootArgs.getWindowHeight());
}
} else {
if (ImGui.menuItem(FontAwesomeIcons.FighterJet + " Full Screen")) {
Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
}
}
ImGui.separator();
List<DeskAppLauncher> menu = deskAppService.getMenuSection(DeskAppMenuSection.SYSTEM);
if (!menu.isEmpty()) {
if (ImGui.beginMenu(DeskAppMenuSection.SYSTEM.name())) {
for (DeskAppLauncher launcher: menu) {
if (ImGui.menuItem(launcher.getName())) {
DeskApp controller = launcher.getLauncher().get();
controller.create();
appScreen.getDeskAppController().addDeskApp(controller);
}
}
ImGui.endMenu();
}
}
if (ImGui.menuItem(FontAwesomeIcons.CreditCard + " Credits")) {
terminal.selectScreen(ScreenCredits.class);
}
if (ImGui.menuItem(FontAwesomeIcons.HandsHelping + " Help")) {
terminal.selectScreen(ScreenHelp.class);
}
ImGui.separator();
if (ImGui.menuItem(FontAwesomeIcons.PowerOff + " Shutdown")) {
bootArgs.shutdown();
}
ImGui.endMenu();
}
}
}

View file

@ -0,0 +1,34 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.slf4j.impl;
public class MyClass {
public static void fakeDepToBootSLF4J(String out) {
}
}

View file

@ -0,0 +1,18 @@
SystemBaseGlyphApp.title=Sys Glyph Set
SystemBaseGlyphApp.showBase27=Show base27
SystemBaseGlyphApp.colScript=Script
SystemBaseGlyphApp.col10Num=10Numbers
SystemBaseGlyphApp.col16Num=16Numbers
SystemBaseGlyphApp.col27Num=27Numbers
SystemBasePartApp.title=Sys Number Parts
SystemBasePartApp.selectBase=Base
SystemBasePartApp.selectName=Name:
SystemBasePartApp.selectPurpose=Purpose:
SystemBasePartApp.showBase10=Show base10
SystemBasePartApp.showBase16=Show base16
SystemBasePartApp.showBase27=Show base27
SystemBaseUnicodePlaneApp.title=Sys Unicode Plane
SystemBaseUnicodePlaneApp.colPlane=Unicode Plane
SystemBaseUnicodePlaneApp.colText=Example

View file

@ -0,0 +1,14 @@
SystemBaseGlyphApp.title=\uE0C0 \uE13F \uE2F4 \uE3BC \uE0ED \uE1CC \uE191 \uE2F4 \uE20F
SystemBaseGlyphApp.showBase27=\uE219 \uE362 \uE0C0 \uE13F \uE2F4 \uE387 \uE400
SystemBaseGlyphApp.colScript=\uE2F4 \uE3A1 \uE08B \uE1CB \uE2AA \uE20F
SystemBaseGlyphApp.col10Num=\uE386 \uE216 \uE171 \uE153 \uE0C0 \uE08C \uE2F4
SystemBaseGlyphApp.col16Num=\uE386 \uE3FF \uE216 \uE171 \uE153 \uE0C0 \uE08C \uE2F4
SystemBaseGlyphApp.col27Num=\uE387 \uE400 \uE216 \uE171 \uE153 \uE0C0 \uE08C \uE2F4
SystemBasePartApp.title=\uE0C0 \uE13F \uE2F4 \uE203 \uE13F \uE08C \uE20F \uE2F4
SystemBasePartApp.selectBase=\uE0C0 \uE13F \uE2F4
SystemBasePartApp.selectName=\uE216 \uE13F \uE153 \uE3EC
SystemBasePartApp.selectPurpose=\uE203 \uE171 \uE08C \uE203 \uE2F4 \uE3EC
SystemBasePartApp.showBase10=\uE219 \uE362 \uE0C0 \uE13F \uE2F4 \uE386
SystemBasePartApp.showBase16=\uE219 \uE362 \uE0C0 \uE13F \uE2F4 \uE386 \uE3FF
SystemBasePartApp.showBase27=\uE219 \uE362 \uE0C0 \uE13F \uE2F4 \uE387 \uE400