Bootup as osgi bundles

This commit is contained in:
Willem Cazander 2022-03-01 19:03:03 +01:00
parent 9afa43331a
commit b526b97558
122 changed files with 1762 additions and 681 deletions

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

@ -0,0 +1,106 @@
<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>
<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>
<instructions>
<_donotcopy>(.git)</_donotcopy>
<Import-Package>
love.distributedrebirth.gdxapp4d.tos4.service,
org.osgi.framework,
com.badlogic.gdx,
com.badlogic.gdx.assets,
com.badlogic.gdx.assets.loaders,
com.badlogic.gdx.assets.loaders.resolvers,
com.badlogic.gdx.audio,
com.badlogic.gdx.files,
com.badlogic.gdx.graphics,
com.badlogic.gdx.graphics.g2d,
com.badlogic.gdx.graphics.g3d,
com.badlogic.gdx.graphics.g3d.attributes,
com.badlogic.gdx.graphics.g3d.decals,
com.badlogic.gdx.graphics.g3d.environment,
com.badlogic.gdx.graphics.g3d.loader,
com.badlogic.gdx.graphics.g3d.model,
com.badlogic.gdx.graphics.g3d.model.data,
com.badlogic.gdx.graphics.g3d.particles,
com.badlogic.gdx.graphics.g3d.particles.bactches,
com.badlogic.gdx.graphics.g3d.particles.emitters,
com.badlogic.gdx.graphics.g3d.particles.influencers,
com.badlogic.gdx.graphics.g3d.particles.renderers,
com.badlogic.gdx.graphics.g3d.particles.values,
com.badlogic.gdx.graphics.g3d.shaders,
com.badlogic.gdx.graphics.g3d.utils,
com.badlogic.gdx.graphics.g3d.utils.shapebuilders,
com.badlogic.gdx.graphics.glutils,
com.badlogic.gdx.graphics.profiling,
com.badlogic.gdx.input,
com.badlogic.gdx.maps,
com.badlogic.gdx.maps.objects,
com.badlogic.gdx.maps.tiled,
com.badlogic.gdx.maps.tiled.objects,
com.badlogic.gdx.maps.tiled.renderers,
com.badlogic.gdx.maps.tiled.tiles,
com.badlogic.gdx.math,
com.badlogic.gdx.math.collision,
com.badlogic.gdx.net,
com.badlogic.gdx.scenes.scene2d,
com.badlogic.gdx.scenes.scene2d.actions,
com.badlogic.gdx.scenes.scene2d.ui,
com.badlogic.gdx.scenes.scene2d.utils,
com.badlogic.gdx.utils,
com.badlogic.gdx.utils.async,
com.badlogic.gdx.utils.compression,
com.badlogic.gdx.utils.compression.lz,
com.badlogic.gdx.utils.compression.lzma,
com.badlogic.gdx.utils.compression.rangecoder,
com.badlogic.gdx.utils.reflect,
com.badlogic.gdx.utils.viewport,
imgui,
imgui.flag,
imgui.glfw,
imgui.gl3,
imgui.type,
net.spookygames.gdx.nativefilechooser,
love.distributedrebirth.bassboonyd,
love.distributedrebirth.bassboonyd.jmx,
love.distributedrebirth.numberxd,
love.distributedrebirth.numberxd.base2t,
love.distributedrebirth.numberxd.base2t.part,
love.distributedrebirth.numberxd.base2t.part.warp,
love.distributedrebirth.numberxd.base2t.type,
love.distributedrebirth.numberxd.base2t.typexl,
love.distributedrebirth.numberxd.glyph,
love.distributedrebirth.numberxd.x4o,
</Import-Package>
<Export-Package>love.distributedrebirth.gdxapp4d.vrgem4.service</Export-Package>
<Private-Package>love.distributedrebirth.gdxapp4d.vrgem4.*</Private-Package>
<!--
<Embed-Dependency>*;artifactId=gdx;inline=true,*;artifactId=gdx-nativefilechooser;inline=true</Embed-Dependency>
-->
<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,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<root:ocean xmlns:root="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root"
xmlns:link="http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-link"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root-1.0.xsd">
<link:sea name="vrGEM4" provider="gdxapp4d.system" author="willemtsade">
<link:magic file="gdxapp4d-vrgem4.jar" mime="application/vnd.osgi.bundle"/>
</link:sea>
</root:ocean>

View file

@ -0,0 +1,24 @@
package love.distributedrebirth.gdxapp4d.vrgem4;
import java.util.function.Supplier;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DefaultDeskApp;
public final class GDXAppLauncher {
private final String name;
private final Supplier<DefaultDeskApp> launcher;
public GDXAppLauncher(String name, Supplier<DefaultDeskApp> launcher) {
this.name = name;
this.launcher = launcher;
}
public String getName() {
return name;
}
public Supplier<DefaultDeskApp> getLauncher() {
return launcher;
}
}

View file

@ -0,0 +1,43 @@
package love.distributedrebirth.gdxapp4d.vrgem4;
import java.util.List;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnClassInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnPackageInfoʸᴰ;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumInstanceᴶᴹˣ;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpTerminal;
import love.distributedrebirth.gdxapp4d.vrgem4.music.MusicManager;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
@BãßBȍőnClassInfoʸᴰ(name = "GDXAppMain", purpose = "Main loop render dispatcher and bootup.")
@BãßBȍőnPackageInfoʸᴰ(name = "love.distributedrebirth.gdxapp")
public enum GDXAppVrGem4 implements DefaultEnumInstanceᴶᴹˣ<GDXAppVrGem4,GDXAppVrGem4Keyʸᴰ> {
INSTANCE;
public SystemWarpTerminal terminal;
public MusicManager music;
//public FontAtlas basePlane;
private final BãßBȍőnCoffinOpenʸᴰ<GDXAppVrGem4Keyʸᴰ> BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance();
public BãßBȍőnCoffinʸᴰ<GDXAppVrGem4Keyʸᴰ> GET_BBC() { return BBC; }
private GDXAppVrGem4() {
BBC.BOON_INIT(this);
BȍőnJmxInit(GDXAppVrGem4Keyʸᴰ.JMX);
}
public void init(List<String> args, SystemWarpTerminal terminal) {
boolean musicStop = args.contains("music-stop");
if (musicStop) {
System.out.println("music-stop: requested");
}
music = new MusicManager();
music.init(musicStop);
this.terminal = terminal;
}
}

View file

@ -0,0 +1,159 @@
package love.distributedrebirth.gdxapp4d.vrgem4;
import java.util.List;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import com.badlogic.gdx.Gdx;
import imgui.type.ImBoolean;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumBaseᴶᴹˣ;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpTerminal;
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.screen.ScreenIntro;
import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenIntroMission;
import love.distributedrebirth.numberxd.base2t.Base2PartsFactory;
import love.distributedrebirth.numberxd.base2t.Base2Terminator;
import love.distributedrebirth.numberxd.base2t.part.warp.TOSWarpCore;
import love.distributedrebirth.numberxd.glyph.BaseGlyphSet;
import love.distributedrebirth.warpme.core.WaterBucket;
import love.distributedrebirth.warpme.core.WaterBucketDriver;
public class GDXAppVrGem4Activator implements BundleActivator {
// private static final Logger LOG = LoggerFactory.getLogger(GDXAppVrGem4Activator.class);
@Override
public void stop(final BundleContext context) {
}
@Override
public void start(final BundleContext context) {
// LOG.info("GDXAppVrGem4Activator started");
ServiceReference<SystemWarpTerminal> termRef = context.getServiceReference(SystemWarpTerminal.class);
SystemWarpTerminal terminal = context.getService(termRef);
GDXAppVrGem4BootScreen bootScreen = new GDXAppVrGem4BootScreen();
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) {
}
bootScreen.bootLine("vrGEM4 Booting...");
// ref to init
// LOG.debug("BãßBȍőnCoffinʸᴰ init......");
for (DefaultEnumBaseᴶᴹˣ<?,?> coffin:coffinInstances()) {
BãßBȍőnCoffinOpenʸᴰ.lockCoffin(coffin);
}
bootScreen.bootLine("BãßBȍőnCoffinʸᴰ init done.");
bootScreen.bootLine("ImGui Setup");
ImBoolean imLoaded = new ImBoolean(false);
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
ImGuiSetup.init();
imLoaded.set(true);
}
});
while (!imLoaded.get()) {
try {
Thread.sleep(100);
} catch (InterruptedException ignored) {
}
}
bootScreen.bootLine("ImGui Loaded");
ServiceReference<SystemWarpBootArgs> bootArgsRef = context.getServiceReference(SystemWarpBootArgs.class);
SystemWarpBootArgs bootArgs = context.getService(bootArgsRef);
List<String> args = bootArgs.getBootArgs();
try {
if (args.contains("warpcore-load")) {
bootScreen.bootLine("warpcore-load: requested");
WaterBucket bucket = WaterBucketDriver.newInstance().createReader().readFile("./warpcore.xml");
TOSWarpCore.INSTANCE.BãßArmWarpCore(bucket);
}
if (args.contains("warpcore-save")) {
bootScreen.bootLine("warpcore-save: requested");
WaterBucket bucket = TOSWarpCore.INSTANCE.BãßCurrentWarpCore();
WaterBucketDriver.newInstance().createWriter().writeFile(bucket, "./warpcore.xml");
}
} catch (Exception e) {
throw new RuntimeException(e);
}
if (!args.contains("warpcore-nolock")) {
bootScreen.bootLine("warpcore-lock: BãßLockWarpCipher");
TOSWarpCore.INSTANCE.BãßLockWarpCipher();
} else {
bootScreen.bootLine("warpcore-nolock: requested");
}
if (args.contains("full-screen")) {
System.out.println("full-screen: requested");
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
}
});
}
GDXAppVrGem4.INSTANCE.init(args, terminal);
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
terminal.registrateScreen(new ScreenIntro());
terminal.registrateScreen(new ScreenIntroMission());
terminal.registrateScreen(new ScreenDesktop1());
terminal.registrateScreen(new ScreenDesktop2());
terminal.registrateScreen(new ScreenDesktop3());
terminal.registrateScreen(new ScreenDesktop4());
terminal.registrateScreen(new ScreenCredits());
terminal.registrateScreen(new ScreenHelp());
if (args.contains("intro-skip")) {
System.out.println("intro-skip: requested");
terminal.selectScreen(ScreenDesktop1.class);
// music.play(MusicSongType.BACKGROUND);
} else {
terminal.selectScreen(ScreenIntro.class);
}
}
});
}
//TODO: add layer or ?? private <T extends BãßBȍőnCoffinStoreʸᴰ<?>,DefaultAuthorInfoʸᴰ> T[] storeInstances() {
@SuppressWarnings("unchecked")
private <T extends DefaultEnumBaseᴶᴹˣ<?,?>> T[] coffinInstances() {
return (T[]) new DefaultEnumBaseᴶᴹˣ[] {
GDXAppVrGem4.INSTANCE,
BaseGlyphSet.values()[0],
Base2Terminator.INSTANCE,
Base2PartsFactory.INSTANCE,
TOSWarpCore.INSTANCE
};
}
}

View file

@ -0,0 +1,6 @@
package love.distributedrebirth.gdxapp4d.vrgem4;
public interface GDXAppVrGem4BootListener {
void bootLine(String message);
}

View file

@ -0,0 +1,56 @@
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;
public class GDXAppVrGem4BootScreen extends ScreenAdapter implements GDXAppVrGem4BootListener {
private BitmapFont font;
private SpriteBatch batch;
private Texture backgroundImage;
private List<String> messages = new ArrayList<>();
public GDXAppVrGem4BootScreen() {
}
public void create() {
batch = new SpriteBatch();
backgroundImage = new Texture(Gdx.files.internal("background/temple-os.png"));
font = new BitmapFont();
}
@Override
public void render(float delta) {
int textX = 40;
int textY = Gdx.graphics.getHeight();
int textYStep = 20;
batch.begin();
synchronized (messages) {
for (String message:messages) {
font.draw(batch, message, textX, textY-=textYStep);
}
batch.draw(backgroundImage, textY, textY, textY, textY);
}
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,12 @@
package love.distributedrebirth.gdxapp4d.vrgem4;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinStoreKeyʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public enum GDXAppVrGem4Keyʸᴰ implements BãßBȍőnCoffinStoreKeyʸᴰ {
JMX,
;
}

View file

@ -0,0 +1,96 @@
package love.distributedrebirth.gdxapp4d.vrgem4;
import com.badlogic.gdx.Gdx;
import imgui.ImFontConfig;
import imgui.ImFontGlyphRangesBuilder;
import imgui.ImGui;
import imgui.ImGuiIO;
import imgui.ImGuiStyle;
import imgui.gl3.ImGuiImplGl3;
import imgui.glfw.ImGuiImplGlfw;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
/**
* Create and shutdown of ImGui and font activations.
*/
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class ImGuiSetup {
public static final ImGuiImplGlfw imGuiImp = new ImGuiImplGlfw();
public static final ImGuiImplGl3 imGuiGlImp = new ImGuiImplGl3();
public static void init() {
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());
imGuiImp.init(windowHandle, true);
imGuiGlImp.init("#version 140");
ImGui.init();
initStyle();
}
private static void initStyle() {
ImGui.styleColorsDark();
ImGuiStyle style = ImGui.getStyle();
style.setWindowRounding(0f);
style.setWindowBorderSize(0f);
style.setWindowPadding(6f, 6f);
style.setScrollbarSize(22f);
}
private static void initFonts(final ImGuiIO io) {
ImFontConfig fontConfig = new ImFontConfig();
ImFontGlyphRangesBuilder fontBuilder = new ImFontGlyphRangesBuilder();
addRangeUnicodePlane0(fontBuilder);
final short[] glyphRanges = fontBuilder.buildRanges();
// Base font has almost everything
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/code-2000.ttf").readBytes(), 22, fontConfig, glyphRanges);
fontConfig.setMergeMode(true);
// note: merges ~148 chars, just for 3 sub chars for SUBHEX, but still missing 2 chars from T12 alt1 clock
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/free-sans.ttf").readBytes(), 22, fontConfig, glyphRanges);
// Egyptian hieroglyphs
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/new-gardiner-bmp.ttf").readBytes(), 22, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/fa-solid-900.ttf").readBytes(), 22, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-samaritan.ttf").readBytes(), 22, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-sinhala.ttf").readBytes(), 22, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-serif-tibetan.ttf").readBytes(), 22, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-tagalog.ttf").readBytes(), 22, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-tagbanwa.ttf").readBytes(), 22, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-tai-le.ttf").readBytes(), 22, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-tai-tham.ttf").readBytes(), 22, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-batak.ttf").readBytes(), 22, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-lepcha.ttf").readBytes(), 22, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-balinese.ttf").readBytes(), 22, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-sundanese.ttf").readBytes(), 22, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-lisu.ttf").readBytes(), 22, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-bamum.ttf").readBytes(), 22, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-glagolitic.ttf").readBytes(), 22, fontConfig, glyphRanges);
// Missig plane 1++
// - code-2001
// - code-2002
// - noto-sans-brahmi
fontConfig.destroy();
}
private static void addRangeUnicodePlane0(ImFontGlyphRangesBuilder fontBuilder) {
for (int c=0x0001;c<=0xFFEF;c++) {
StringBuilder buf = new StringBuilder();
buf.append(""+(char)c);
fontBuilder.addText(buf.toString());
}
}
public static void dispose() {
imGuiImp.dispose();
imGuiGlImp.dispose();
ImGui.destroyContext();
}
}

View file

@ -0,0 +1,38 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class DefaultDeskApp implements DeskApp {
private String title;
private String icon;
private final DeskAppContour contours;
public DefaultDeskApp() {
this.contours = new DeskAppContour();
}
public void setTitle(String title) {
this.title = title;
}
@Override
public String getTitle() {
return title;
}
public void setIcon(String icon) {
this.icon = icon;
}
@Override
public String getIcon() {
return icon;
}
@Override
public DeskAppContour getContours() {
return contours;
}
}

View file

@ -0,0 +1,13 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface DeskApp {
String getTitle();
String getIcon();
DeskAppContour getContours();
}

View file

@ -0,0 +1,24 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import java.util.HashMap;
import java.util.Map;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class DeskAppContour {
private final Map<DeskAppContourSection, DeskAppRenderer> renderers;
public DeskAppContour() {
this.renderers = new HashMap<>();
}
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,27 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", 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,9 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface DeskAppRenderer {
void render();
}

View file

@ -0,0 +1,75 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import java.util.ArrayList;
import java.util.List;
import imgui.ImGui;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class DeskAppScreen {
private final String name;
private final List<DeskApp> deskApps;
private DeskApp currentDeskApp;
private final List<DeskAppScreenListener> deskAppListeners;
public DeskAppScreen(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);
}
public List<DeskApp> getDeskApps() {
return deskApps;
}
public DeskApp getCurrentDeskApp() {
return currentDeskApp;
}
public void setCurrentDeskApp(DeskApp currentDeskApp) {
this.currentDeskApp = currentDeskApp;
for (DeskAppScreenListener listener: deskAppListeners) {
listener.selectDeskApp(currentDeskApp);
}
}
public void addDeskAppListener(DeskAppScreenListener listener) {
deskAppListeners.add(listener);
}
public final void renderMenu() {
for (DeskApp app: deskApps) {
if (ImGui.menuItem(app.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() {
}
}

View file

@ -0,0 +1,9 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface DeskAppScreenListener {
void selectDeskApp(DeskApp deskApp);
}

View file

@ -0,0 +1,96 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import com.badlogic.gdx.InputProcessor;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class DeskTopInputProcessor implements InputProcessor {
private final InputProcessor input;
private boolean filtering = false;
public DeskTopInputProcessor(InputProcessor input) {
this.input = input;
}
public void setFiltering(boolean filtering) {
this.filtering = filtering;
}
public boolean isFiltering() {
return filtering;
}
@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 (filtering) {
return false;
} else {
return input.touchDown(screenX, screenY, pointer, button);
}
}
@Override
public boolean touchUp(int screenX, int screenY, int pointer, int button) {
if (filtering) {
return false;
} else {
return input.touchUp(screenX, screenY, pointer, button);
}
}
@Override
public boolean touchDragged(int screenX, int screenY, int pointer) {
if (filtering) {
return false;
} else {
return input.touchDragged(screenX, screenY, pointer);
}
}
@Override
public boolean mouseMoved(int screenX, int screenY) {
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,11 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import com.badlogic.gdx.Screen;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface DeskTopScreen extends Screen {
DeskAppScreen getDeskAppScreen();
}

View file

@ -0,0 +1,249 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop;
import java.util.ArrayList;
import java.util.List;
import com.badlogic.gdx.Gdx;
import imgui.ImGui;
import imgui.type.ImBoolean;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.tos4.GDXAppTos4;
import love.distributedrebirth.gdxapp4d.vrgem4.FontAwesomeIcons;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppLauncher;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps.BasicConsoleApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps.HebrewWalletApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps.MusicPlayerApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps.SystemBaseGlyphApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps.SystemBasePartApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps.SystemBaseUnicodePlaneApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps.Unicode4DApp;
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;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class DeskTopScreenMenu {
private List<GDXAppLauncher> apps;
private ImBoolean fileMinimizeSelected = new ImBoolean(false);
private ImBoolean fileCloseSelected = new ImBoolean(false);
public DeskTopScreenMenu() {
apps = new ArrayList<>();
apps.add(new GDXAppLauncher("Basic Console", () -> new BasicConsoleApp()));
apps.add(new GDXAppLauncher("Sys Glyph Set", () -> new SystemBaseGlyphApp()));
apps.add(new GDXAppLauncher("Sys Number Parts", () -> new SystemBasePartApp()));
apps.add(new GDXAppLauncher("Sys Unicode", () -> new SystemBaseUnicodePlaneApp()));
apps.add(new GDXAppLauncher("Hebrew Wallet", () -> new HebrewWalletApp()));
apps.add(new GDXAppLauncher("Unicode4D", () -> new Unicode4DApp()));
apps.add(new GDXAppLauncher("Music Player", () -> new MusicPlayerApp()));
}
public void renderMenu(DeskTopScreen appScreen) {
DeskApp deskApp = appScreen.getDeskAppScreen().getCurrentDeskApp();
ImGui.beginMainMenuBar();
renderVRGEM4Menu(appScreen);
renderTOS4Menu(appScreen);
if (deskApp != null) {
renderEditMenu(deskApp);
renderFileMenu(deskApp);
renderSelfMenu(appScreen, deskApp);
}
ImGui.endMainMenuBar();
}
private void renderSelfMenu(DeskTopScreen appScreen, DeskApp deskApp) {
if (ImGui.beginMenu(deskApp.getTitle())) {;
if (ImGui.menuItem(FontAwesomeIcons.FolderMinus + " Minimize", "", fileMinimizeSelected, deskApp != null )) {
fileMinimizeSelected.set(false);
if (deskApp != null) {
appScreen.getDeskAppScreen().setCurrentDeskApp(null);
}
}
if (ImGui.menuItem(FontAwesomeIcons.WindowClose + " Exit", "", fileCloseSelected, deskApp != null)) {
fileCloseSelected.set(false);
if (deskApp != null) {
appScreen.getDeskAppScreen().removeDeskApp(deskApp);
appScreen.getDeskAppScreen().setCurrentDeskApp(null);
}
}
ImGui.endMenu();
}
}
private void renderFileMenu(DeskApp deskApp) {
DeskAppRenderer fileNew = deskApp.getContours().getContour(DeskAppContourSection.FILE_NEW);
DeskAppRenderer fileClose = deskApp.getContours().getContour(DeskAppContourSection.FILE_CLOSE);
DeskAppRenderer fileSave = deskApp.getContours().getContour(DeskAppContourSection.FILE_SAVE);
DeskAppRenderer fileOption = deskApp.getContours().getContour(DeskAppContourSection.FILE_OPTION);
DeskAppRenderer filePrint = deskApp.getContours().getContour(DeskAppContourSection.FILE_PRINT);
if (fileNew == null && fileClose == null && fileSave == null && fileOption == null && filePrint == null) {
return;
}
if (ImGui.beginMenu(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")) {
appScreen.getDeskAppScreen().setCurrentDeskApp(null);
}
for (DeskApp app: appScreen.getDeskAppScreen().getDeskApps()) {
String infix = "";
if (appScreen.getDeskAppScreen().getCurrentDeskApp() == app) {
infix = FontAwesomeIcons.Wrench + " ";;
}
if (ImGui.menuItem(infix + app.getTitle())) {
appScreen.getDeskAppScreen().setCurrentDeskApp(app);
}
}
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")) {
GDXAppVrGem4.INSTANCE.terminal.selectScreen(ScreenDesktop1.class);
}
if (ImGui.menuItem(infix2+"Desktop2")) {
GDXAppVrGem4.INSTANCE.terminal.selectScreen(ScreenDesktop2.class);
}
if (ImGui.menuItem(infix3+"Desktop3")) {
GDXAppVrGem4.INSTANCE.terminal.selectScreen(ScreenDesktop3.class);
}
if (ImGui.menuItem(infix4+"Desktop4")) {
GDXAppVrGem4.INSTANCE.terminal.selectScreen(ScreenDesktop4.class);
}
ImGui.separator();
if (ImGui.beginMenu(FontAwesomeIcons.PlusSquare + " Start App")) {
for (GDXAppLauncher launcher: apps) {
if (ImGui.menuItem(launcher.getName())) {
appScreen.getDeskAppScreen().addDeskApp(launcher.getLauncher().get());
}
}
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(GDXAppVrGem4.INSTANCE.viewWidth, GDXAppVrGem4.INSTANCE.viewHeight);
}
} else {
if (ImGui.menuItem(FontAwesomeIcons.FighterJet + " Full Screen")) {
// Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
}
}
ImGui.separator();
if (ImGui.menuItem(FontAwesomeIcons.CreditCard + " Credits")) {
GDXAppVrGem4.INSTANCE.terminal.selectScreen(ScreenCredits.class);
}
if (ImGui.menuItem(FontAwesomeIcons.HandsHelping + " Help")) {
GDXAppVrGem4.INSTANCE.terminal.selectScreen(ScreenHelp.class);
}
ImGui.separator();
if (ImGui.menuItem(FontAwesomeIcons.Trademark + " ImGui Demo")) {
// GDXAppVrGem4.INSTANCE.showImGuiDemo.set(true);
}
if (ImGui.menuItem(FontAwesomeIcons.PowerOff + " Shutdown")) {
// GDXAppVrGem4.INSTANCE.dispose();
System.exit(0);
}
ImGui.endMenu();
}
}
}

View file

@ -0,0 +1,29 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps;
import imgui.ImGui;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppRenderer;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class BasicConsoleApp extends DefaultDeskApp {
public BasicConsoleApp() {
setTitle("Basic Conssole");
getContours().registrateContour(DeskAppContourSection.MAIN, new DeskAppRenderer() {
@Override
public void render() {
ImGui.text("10 PRINT \"The BASIC Shahada of DUNE;\"");
ImGui.text("20 PRINT \"- THERE IS NO GOD BUT @Ω仙⁴\"");
ImGui.text("30 PRINT \"- THERE IS NO RULE BUT CONSENT\"");
ImGui.text("40 PRINT \"- THERE IS NO FAILURE BUT DEATH\"");
ImGui.text("50 PRINT \"- TERRY A. DAVIS WAS THE PROPHET OF @Ω仙9⁴\"");
ImGui.text("60 PRINT \"- TERRY A. DAVIS WAS THE FIRST TRUE MENTAT\"");
ImGui.text("70 PRINT \"- TERRY A. DAVIS WAS THE BEST CODER ALIVE\"");
ImGui.text("RUN");
}
});
}
}

View file

@ -0,0 +1,55 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps;
import imgui.ImGui;
import imgui.flag.ImGuiTableFlags;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppRenderer;
import love.distributedrebirth.numberxd.Gê̄ldGetậl;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class HebrewWalletApp extends DefaultDeskApp implements DeskAppRenderer {
public HebrewWalletApp() {
setTitle("Hebrew Wallet");
getContours().registrateContour(DeskAppContourSection.MAIN, this);
}
@Override
public void render() {
ImGui.text("Current amount:");
ImGui.sameLine();
ImGui.text("0000");
ImGui.separator();
if (ImGui.button("Pay")) {
}
int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV;
ImGui.beginTable("wallet", 4, flags);
ImGui.tableSetupColumn("In/Out");
ImGui.tableSetupColumn("AmountRaw");
ImGui.tableSetupColumn("AmountFix");
ImGui.tableSetupColumn("Decimal");
ImGui.tableHeadersRow();
String[] walletData = {
"ה","מ","מָ","ח","חֱ","חֱ‎מָא",
"א","בד","ב","ד","ץףן",
"הזפץ","מספר","צצצצ","ץאאא","דואר"
};
for (String data:walletData) {
Gê̄ldGetậl geld = new Gê̄ldGetậl(data);
Gê̄ldGetậl geld2 = geld.toClone(); // unit test
ImGui.tableNextRow();
ImGui.tableNextColumn();
ImGui.text(data.length()==2||data.length()==3?"OUT":"IN");
ImGui.tableNextColumn();
ImGui.text(data);
ImGui.tableNextColumn();
ImGui.text(geld2.toHebrewString(true)); // true=reverse for ImGui
ImGui.tableNextColumn();
ImGui.text(Double.toString(geld.getTotalDecimalValue()));
}
ImGui.endTable();
}
}

View file

@ -0,0 +1,126 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps;
import java.util.function.Consumer;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import imgui.ImGui;
import imgui.flag.ImGuiSelectableFlags;
import imgui.flag.ImGuiTableColumnFlags;
import imgui.flag.ImGuiTableFlags;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.tos4.GDXAppTos4;
import love.distributedrebirth.gdxapp4d.vrgem4.FontAwesomeIcons;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppRenderer;
import love.distributedrebirth.gdxapp4d.vrgem4.music.MusicSong;
import net.spookygames.gdx.nativefilechooser.NativeFileChooserCallback;
import net.spookygames.gdx.nativefilechooser.NativeFileChooserConfiguration;
/**
* The music player ui.
*/
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class MusicPlayerApp extends DefaultDeskApp implements DeskAppRenderer {
private final NativeFileChooserConfiguration fileChooserConfig;
public MusicPlayerApp() {
setTitle(FontAwesomeIcons.Music + " Music Player");
getContours().registrateContour(DeskAppContourSection.MAIN, this);
getContours().registrateContour(DeskAppContourSection.FILE_NEW, new DeskAppRenderer() {
@Override
public void render() {
if (ImGui.menuItem(FontAwesomeIcons.Plus + " Add")) {
// GDXAppVrGem4.INSTANCE.terminal.getFileChooser().chooseFile(fileChooserConfig,
// NativeFileChooserCallbackAdapter.onFileChosen(v -> GDXAppVrGem4.INSTANCE.music.addBackgroundMusic(v)));
}
}
});
fileChooserConfig = new NativeFileChooserConfiguration();
fileChooserConfig.directory = Gdx.files.absolute(System.getProperty("user.home"));
fileChooserConfig.mimeFilter = "audio/*";
fileChooserConfig.title = "Choose audio file";
}
@Override
public void render() {
ImGui.text("Current Song:");
MusicSong currentSong = GDXAppVrGem4.INSTANCE.music.getCurrentSong();
if (currentSong != null) {
ImGui.sameLine();
ImGui.text(currentSong.getName());
}
ImGui.separator();
if (currentSong != null) {
if (ImGui.button("Play")) {
GDXAppVrGem4.INSTANCE.music.play(currentSong);
}
} else {
ImGui.text("Play");
}
ImGui.sameLine();
if (ImGui.button("<")) {
GDXAppVrGem4.INSTANCE.music.prev();
}
ImGui.sameLine();
if (ImGui.button(">")) {
GDXAppVrGem4.INSTANCE.music.next();
}
ImGui.sameLine();
if (ImGui.button("Stop")) {
GDXAppVrGem4.INSTANCE.music.stop();
}
int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV;
ImGui.beginTable("playlist", 3, flags);
ImGui.tableSetupColumn("#", ImGuiTableColumnFlags.NoHide);
ImGui.tableSetupColumn("Play");
ImGui.tableSetupColumn("Name");
ImGui.tableHeadersRow();
int i=1;
for (MusicSong song:GDXAppVrGem4.INSTANCE.music.getBackgroundSongs()) {
ImGui.pushID(i);
ImGui.tableNextRow();
ImGui.tableNextColumn();
ImGui.selectable(""+i, song.isPlaying(), ImGuiSelectableFlags.None);
ImGui.tableNextColumn();
if (ImGui.smallButton(">")) {
GDXAppVrGem4.INSTANCE.music.play(song);
}
ImGui.tableNextColumn();
ImGui.selectable(song.getName(), song.isPlaying(), ImGuiSelectableFlags.None);
ImGui.popID();
i++;
}
ImGui.endTable();
}
static class NativeFileChooserCallbackAdapter implements NativeFileChooserCallback {
@Override
public void onFileChosen(FileHandle file) {
}
@Override
public void onCancellation() {
}
@Override
public void onError(Exception exception) {
}
static NativeFileChooserCallbackAdapter onFileChosen(Consumer<FileHandle> eater) {
return new NativeFileChooserCallbackAdapter() {
@Override
public void onFileChosen(FileHandle file) {
eater.accept(file);
}
};
}
}
}

View file

@ -0,0 +1,94 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps;
import java.util.Locale;
import java.util.ResourceBundle;
import imgui.ImGui;
import imgui.flag.ImGuiTableFlags;
import imgui.type.ImBoolean;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppRenderer;
import love.distributedrebirth.numberxd.glyph.BaseGlyphSet;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class SystemBaseGlyphApp extends DefaultDeskApp {
private final ImBoolean showBase27 = new ImBoolean(false);
private String getTxt(String key) {
ResourceBundle bundle = ResourceBundle.getBundle("love.distributedrebirth.gdxapp.Main", new Locale("en"));
return bundle.getString("SystemBaseGlyphApp."+key);
}
public SystemBaseGlyphApp() {
setTitle(getTxt("title"));
getContours().registrateContour(DeskAppContourSection.MAIN, new DeskAppRenderer() {
@Override
public void render() {
ImGui.checkbox(getTxt("showBase27"), showBase27);
int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV | ImGuiTableFlags.Resizable;
ImGui.beginTable("base-part", 3, flags);
ImGui.tableSetupColumn(getTxt("colScript"));
ImGui.tableSetupColumn(getTxt("col10Num"));
if (showBase27.get()) {
ImGui.tableSetupColumn(getTxt("col27Num"));
} else {
ImGui.tableSetupColumn(getTxt("col16Num"));
}
ImGui.tableHeadersRow();
for (BaseGlyphSet set:BaseGlyphSet.values()) {
ImGui.tableNextRow();
ImGui.tableNextColumn();
ImGui.text(set.BȍőnNaam());
ImGui.tableNextColumn();
ImGui.text(print10Numbers(set));
ImGui.tableNextColumn();
if (showBase27.get()) {
ImGui.text(print27Numbers(set));
} else {
ImGui.text(print16Numbers(set));
}
}
ImGui.endTable();
}
});
}
private String print10Numbers(BaseGlyphSet set) {
StringBuilder buf = new StringBuilder();
for (int i=0;i<10;i++) {
buf.append(set.BȍőnPrintNumber10(i, 9));
buf.append(" ");
}
return buf.toString();
}
private String print16Numbers(BaseGlyphSet set) {
StringBuilder buf = new StringBuilder();
if (set.BȍőnNumber16() == null) {
return buf.toString();
}
int x=240;
for (int i=0;i<16;i++) {
buf.append(set.BȍőnPrintNumber16(i + x, 16)); // hex; +one
buf.append(" ");
x = x - 16;
}
return buf.toString();
}
private String print27Numbers(BaseGlyphSet set) {
StringBuilder buf = new StringBuilder();
if (set.BȍőnNumber27() == null) {
return buf.toString();
}
for (int i=0;i<27;i++) {
buf.append(set.BȍőnPrintNumber27(i, 26));
buf.append(" ");
}
return buf.toString();
}
}

View file

@ -0,0 +1,186 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
import imgui.ImGui;
import imgui.flag.ImGuiTableFlags;
import imgui.type.ImBoolean;
import imgui.type.ImInt;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppRenderer;
import love.distributedrebirth.numberxd.base2t.Base2PartsFactory;
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartAlt1ʸᴰ;
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartAlt2ʸᴰ;
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartAlt3ʸᴰ;
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartAlt4ʸᴰ;
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartʸᴰ;
import love.distributedrebirth.numberxd.glyph.BaseGlyphSet;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class SystemBasePartApp extends DefaultDeskApp implements DeskAppRenderer {
private ImInt selectedBasePart = new ImInt();
private final ImBoolean showBase10 = new ImBoolean(false);
private final ImBoolean showBase16 = new ImBoolean(false);
private final ImBoolean showBase27 = new ImBoolean(false);
private String getTxt(String key) {
ResourceBundle bundle = ResourceBundle.getBundle("love.distributedrebirth.gdxapp.Main", new Locale("en"));
return bundle.getString("SystemBasePartApp."+key);
}
public SystemBasePartApp() {
setTitle(getTxt("title"));
getContours().registrateContour(DeskAppContourSection.MAIN, this);
}
@Override
public void render() {
List<String> bases = new ArrayList<>();
for (int base:Base2PartsFactory.INSTANCE.BãßBases()) {
bases.add(Integer.toString(base));
}
String[] items = new String[bases.size()];
items = bases.toArray(items);
String selectedItem = items[selectedBasePart.get()];
Integer baseNumber = Integer.valueOf(selectedItem);
BãßBȍőnPartʸᴰ<?>[] baseParts = Base2PartsFactory.INSTANCE.BãßBuildPartsByBase(baseNumber);
ImGui.combo(getTxt("selectBase"), selectedBasePart, items);
ImGui.text(getTxt("selectName"));
ImGui.sameLine();
ImGui.text(baseParts[0].BãßClassNaam());
ImGui.text(getTxt("selectPurpose"));
ImGui.sameLine();
ImGui.text(baseParts[0].BãßClassPurpose());
ImGui.checkbox(getTxt("showBase10"), showBase10);
ImGui.checkbox(getTxt("showBase16"), showBase16);
ImGui.checkbox(getTxt("showBase27"), showBase27);
int columns = 10;
if (showBase10.get()) {
columns += 4;
}
if (showBase16.get()) {
columns += 4;
}
if (showBase27.get()) {
columns += 5;
}
int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV;
ImGui.beginTable("base-part", columns, flags);
ImGui.tableSetupColumn("BȍőnNaam");
ImGui.tableSetupColumn("TelNul");
ImGui.tableSetupColumn("TelEen");
ImGui.tableSetupColumn("Tone");
if (showBase10.get()) {
ImGui.tableSetupColumn("10Tone");
ImGui.tableSetupColumn("10Kor");
ImGui.tableSetupColumn("10Beng");
ImGui.tableSetupColumn("10Arab");
}
if (showBase16.get()) {
ImGui.tableSetupColumn("16Tone");
ImGui.tableSetupColumn("16Kor");
ImGui.tableSetupColumn("16Runi");
ImGui.tableSetupColumn("16LatB");
}
if (showBase27.get()) {
ImGui.tableSetupColumn("27Tone");
ImGui.tableSetupColumn("27Kor");
ImGui.tableSetupColumn("27LatB");
ImGui.tableSetupColumn("27Gre");
ImGui.tableSetupColumn("27Mala");
}
ImGui.tableSetupColumn("prcK");
ImGui.tableSetupColumn("prcV");
ImGui.tableSetupColumn("Alt1");
ImGui.tableSetupColumn("Alt2");
ImGui.tableSetupColumn("Alt3");
ImGui.tableSetupColumn("Alt4");
ImGui.tableHeadersRow();
for (BãßBȍőnPartʸᴰ<?> part:baseParts) {
ImGui.tableNextRow();
ImGui.tableNextColumn();
ImGui.text(part.BȍőnNaam());
ImGui.tableNextColumn();
ImGui.text(Integer.toString(part.BȍőnRangTelNul()));
ImGui.tableNextColumn();
ImGui.text(Integer.toString(part.BȍőnRangTelEen()));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnDialTone());
if (showBase10.get()) {
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.TONE_SCRIPT));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.KOREAN));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.BENGALI));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.ARABIC));
}
if (showBase16.get()) {
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.TONE_SCRIPT));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.KOREAN));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.RUNIC));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.LATIN_BASIC));
}
if (showBase27.get()) {
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber27(BaseGlyphSet.TONE_SCRIPT));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber27(BaseGlyphSet.KOREAN));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber27(BaseGlyphSet.LATIN_BASIC));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber27(BaseGlyphSet.GREEK));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber27(BaseGlyphSet.MALAYALAM));
}
ImGui.tableNextColumn();
ImGui.text(part.BȍőnChinaKey());
ImGui.tableNextColumn();
ImGui.text(part.BȍőnChinaValue());
ImGui.tableNextColumn();
if (part instanceof BãßBȍőnPartAlt1ʸᴰ) {
ImGui.text(BãßBȍőnPartAlt1ʸᴰ.class.cast(part).BȍőnAlt1Value());
} else {
ImGui.text("");
}
ImGui.tableNextColumn();
if (part instanceof BãßBȍőnPartAlt2ʸᴰ) {
ImGui.text(BãßBȍőnPartAlt2ʸᴰ.class.cast(part).BȍőnAlt2Value());
} else {
ImGui.text("");
}
ImGui.tableNextColumn();
if (part instanceof BãßBȍőnPartAlt3ʸᴰ) {
ImGui.text(BãßBȍőnPartAlt3ʸᴰ.class.cast(part).BȍőnAlt3Value());
} else {
ImGui.text("");
}
ImGui.tableNextColumn();
if (part instanceof BãßBȍőnPartAlt4ʸᴰ) {
ImGui.text(BãßBȍőnPartAlt4ʸᴰ.class.cast(part).BȍőnAlt4Value());
} else {
ImGui.text("");
}
}
ImGui.endTable();
}
}

View file

@ -0,0 +1,52 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps;
import java.util.Locale;
import java.util.ResourceBundle;
import imgui.ImGui;
import imgui.flag.ImGuiTableFlags;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppRenderer;
import love.distributedrebirth.unicode4d.UnicodePlaneᶻᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class SystemBaseUnicodePlaneApp extends DefaultDeskApp {
private String getTxt(String key) {
ResourceBundle bundle = ResourceBundle.getBundle("love.distributedrebirth.gdxapp.Main", new Locale("en"));
return bundle.getString("SystemBaseUnicodePlaneApp."+key);
}
public SystemBaseUnicodePlaneApp() {
setTitle(getTxt("title"));
getContours().registrateContour(DeskAppContourSection.MAIN, new DeskAppRenderer() {
@Override
public void render() {
int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV | ImGuiTableFlags.Resizable;
ImGui.beginTable("base-part", 2, flags);
ImGui.tableSetupColumn(getTxt("colPlane"));
ImGui.tableSetupColumn(getTxt("colText"));
ImGui.tableHeadersRow();
for (UnicodePlaneᶻᴰ plane:UnicodePlaneᶻᴰ.values()) {
ImGui.tableNextRow();
ImGui.tableNextColumn();
ImGui.text(plane.name());
ImGui.tableNextColumn();
StringBuilder buf = new StringBuilder();
for (int i=plane.getStart();i<plane.getStart()+33;i++) {
if (i < 65536) {
buf.append((char)i);
}
buf.append(" ");
}
ImGui.text(buf.toString());
}
ImGui.endTable();
}
});
}
}

View file

@ -0,0 +1,74 @@
package love.distributedrebirth.gdxapp4d.vrgem4.desktop.apps;
import java.util.List;
import imgui.ImColor;
import imgui.ImDrawList;
import imgui.ImGui;
import imgui.ImVec2;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppRenderer;
import love.distributedrebirth.numberxd.base2t.type.V072Tong;
import love.distributedrebirth.unicode4d.atlas.FontAtlasStore;
import love.distributedrebirth.unicode4d.atlas.FontAtlasStoreGlyph;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class Unicode4DApp extends DefaultDeskApp implements DeskAppRenderer {
public Unicode4DApp() {
setTitle("Unicode4D");
getContours().registrateContour(DeskAppContourSection.MAIN, this);
}
@Override
public void render() {
ImGui.text("There is unicode and unicode4D");
//FontAtlasStore plane = GDXAppMain.INSTANCE.basePlane.getPlaneByName("MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A");
FontAtlasStoreGlyph glyph = null; //plane.getBaseGlyphByUnicode("27d6");
ImCharacter c = new ImCharacter(glyph);
c.render();
}
class ImCharacter {
private final FontAtlasStoreGlyph glyph;
public ImCharacter(FontAtlasStoreGlyph glyph) {
this.glyph = glyph;
//List<V072Tong> tongs = glyph.getTongs();
}
public void render() {
ImVec2 size = new ImVec2(144f, 48f);
ImGui.invisibleButton("canvas", size.x, size.y);
ImVec2 p0 = ImGui.getItemRectMin();
ImVec2 p1 = ImGui.getItemRectMax(); // p1 = p0 + size
ImDrawList drawList = ImGui.getWindowDrawList();
drawList.pushClipRect(p0.x, p0.y, p1.x, p1.y);
// draw unicode4D
drawList.addQuad(p0.x, p0.y, p0.x+size.x, p0.y, p1.x, p1.y, p0.x, p0.y+size.y,
ImColor.intToColor(127, 127, 255, 255), 5f);
drawList.addLine(p0.x+10, p0.y+40, p0.x+20, p0.y+10, ImColor.intToColor(255, 127, 63, 255));
drawList.addLine(p0.x+30, p0.y+40, p0.x+20, p0.y+10, ImColor.intToColor(255, 127, 63, 255));
drawList.addLine(p0.x+13, p0.y+30, p0.x+27, p0.y+30, ImColor.intToColor(255, 127, 63, 255));
drawList.popClipRect();
//System.out.println("p0.x="+p0.x+" p0.y="+p0.y);
//System.out.println("p1.x="+p1.x+" p1.y="+p1.y);
// for (int n = 0; n < (1.0f + Math.sin(ImGui.getTime() * 5.7f)) * 40.0f; n++) {
// drawList.addCircle(p0.x + size.x * 0.5f, p0.y + size.y * 0.5f, size.y * (0.01f + n * 0.03f),
// ImColor.intToColor(255, 140 - n * 4, n * 3, 255)
// );
// }
}
}
}

View file

@ -0,0 +1,38 @@
package love.distributedrebirth.gdxapp4d.vrgem4.music;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class M3UParser {
private static final String M3U_HEADER = "#EXTM3U";
public class M3UPlaylist {
private List<M3UTrack> tracks = new ArrayList<>();
}
public class M3UTrack {
}
public M3UPlaylist parse(InputStream stream) throws IOException {
M3UPlaylist result = new M3UPlaylist();
BufferedReader buffer = new BufferedReader(new InputStreamReader(stream));
String line = buffer.readLine();
if (!line.startsWith(M3U_HEADER)) {
throw new IOException("Missing header");
}
while ((line = buffer.readLine()) != null) {
}
return result;
}
}

View file

@ -0,0 +1,143 @@
package love.distributedrebirth.gdxapp4d.vrgem4.music;
import java.util.ArrayList;
import java.util.List;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Music.OnCompletionListener;
import com.badlogic.gdx.files.FileHandle;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
/**
* Manages the background and others songs.
*/
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class MusicManager {
// private final MusicSong introSong;
// private final MusicSong creditsSong;
private final List<MusicSong> backgroundSongs;
private final NextSongListener nextSongListener;
private MusicSong currentSong = null;
private boolean noMusic = false;
public MusicManager() {
backgroundSongs = new ArrayList<>();
// introSong = new MusicSong(Gdx.audio.newMusic(Gdx.files.internal("music/panoramacircle-waterfowl.mp3")),"panoramacircle-waterfowl");
// creditsSong = new MusicSong(Gdx.audio.newMusic(Gdx.files.internal("music/idtech-doom-sigil.mp3")), "idtech-doom-sigil");
nextSongListener = new NextSongListener();
}
public void addBackgroundMusic(FileHandle file) {
Music music = Gdx.audio.newMusic(file);
music.setOnCompletionListener(nextSongListener);
backgroundSongs.add(new MusicSong(music, file.name()));
}
public void init(boolean noMusic) {
this.noMusic = noMusic;
/*
addBackgroundMusic(Gdx.files.internal("music/sanctumwave-risen.mp3"));
addBackgroundMusic(Gdx.files.internal("music/sanctumwave-devine-intellect.mp3"));
addBackgroundMusic(Gdx.files.internal("music/theselfhelpgroup-temple-os.mp3"));
addBackgroundMusic(Gdx.files.internal("music/sanctumwave-nightwalk.mp3"));
addBackgroundMusic(Gdx.files.internal("music/beeble-i-used-temple-os-to-write.mp3"));
addBackgroundMusic(Gdx.files.internal("music/ryanfarran-risen-temple-os.mp3"));
*/
}
public void dispose() {
// introSong.music.dispose();
// creditsSong.music.dispose();
for (MusicSong song:backgroundSongs) {
song.music.dispose();
}
}
public List<MusicSong> getBackgroundSongs() {
return backgroundSongs;
}
public MusicSong getCurrentSong() {
return currentSong;
}
public void stop() {
if (currentSong != null) {
currentSong.music.stop();
}
}
public void play(MusicSongType type) {
MusicSong nextSong = null;
if (MusicSongType.INTRO.equals(type)) {
// nextSong = introSong;
// play(nextSong);
} else if (MusicSongType.CREDITS.equals(type)) {
// nextSong = creditsSong;
// play(nextSong);
} else {
int currentBackground = backgroundSongs.indexOf(currentSong);
if (currentBackground == -1 && !backgroundSongs.isEmpty()) {
nextSong = backgroundSongs.get(0);
} else {
nextSong = currentSong;
}
if (!noMusic && nextSong!=null) {
play(nextSong);
}
}
}
public void play(MusicSong song) {
if (song == null) {
return;
}
stop();
currentSong = song;
currentSong.music.play();
}
class NextSongListener implements OnCompletionListener {
@Override
public void onCompletion(Music music) {
next();
play(currentSong);
}
}
public void next() {
int currentBackground = backgroundSongs.indexOf(currentSong);
if (currentBackground == -1) {
return; // some other
}
if (currentBackground == backgroundSongs.size()-1) {
currentBackground = -1; // loop to start
}
boolean play = currentSong.music.isPlaying();
currentSong.music.stop();
currentSong = backgroundSongs.get(currentBackground+1);
if (play) {
currentSong.music.play();
}
}
public void prev() {
int currentBackground = backgroundSongs.indexOf(currentSong);
if (currentBackground == -1) {
return; // some other
}
if (currentBackground == 0) {
currentBackground = backgroundSongs.size(); // loop to end
}
boolean play = currentSong.music.isPlaying();
currentSong.music.stop();
currentSong = backgroundSongs.get(currentBackground-1);
if (play) {
currentSong.music.play();
}
}
}

View file

@ -0,0 +1,27 @@
package love.distributedrebirth.gdxapp4d.vrgem4.music;
import com.badlogic.gdx.audio.Music;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
/**
* The music with the (file) name.
*/
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class MusicSong {
protected final Music music;
private final String name;
public MusicSong(Music music, String name) {
this.music = music;
this.name = name;
}
public String getName() {
return name;
}
public boolean isPlaying() {
return music.isPlaying();
}
}

View file

@ -0,0 +1,13 @@
package love.distributedrebirth.gdxapp4d.vrgem4.music;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
/**
* The song types.
*/
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public enum MusicSongType {
INTRO,
CREDITS,
BACKGROUND
}

View file

@ -0,0 +1,168 @@
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.ModelBatch;
import com.badlogic.gdx.graphics.g3d.ModelInstance;
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 imgui.type.ImBoolean;
import love.distributedrebirth.gdxapp4d.vrgem4.ImGuiSetup;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppContourSection;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppRenderer;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppScreen;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppScreenListener;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskTopInputProcessor;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskTopScreen;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskTopScreenMenu;
public abstract class AbstractScreenDesktop extends ScreenAdapter implements DeskTopScreen {
protected SpriteBatch batch;
protected BitmapFont font;
protected OrthographicCamera camera;
protected ImBoolean showImGuiDemo = new ImBoolean(false);
private DeskTopScreenMenu screenMenu;
private final DeskAppScreen deskAppScreen;
private PerspectiveCamera cam;
private FirstPersonCameraController camController;
private DeskTopInputProcessor inputFilter;
private ModelBatch modelBatch;
private Array<ModelInstance> modelInstances = new Array<ModelInstance>();
public AbstractScreenDesktop(String name) {
this.create();
deskAppScreen = new DeskAppScreen(name);
deskAppScreen.addDeskAppListener(new DeskAppScreenListener() {
@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);
screenMenu = new DeskTopScreenMenu();
modelBatch = new ModelBatch();
cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
cam.position.set(10f, 10f, 10f);
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 DeskTopInputProcessor(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();
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 (showImGuiDemo.get()) {
ImGui.showDemoWindow(showImGuiDemo);
}
if (appScreen != null && appScreen.getDeskAppScreen().getCurrentDeskApp() != null) {
int sizeFlags = ImGuiCond.Always;
ImGui.setNextWindowPos(0, 28, sizeFlags);
ImGui.setNextWindowSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight() - 28, sizeFlags);
int windowFlags = ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoTitleBar;
if (ImGui.begin(appScreen.getDeskAppScreen().getCurrentDeskApp().getTitle(), windowFlags)) {
DeskAppRenderer renderer = appScreen.getDeskAppScreen().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());
//Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight());
//Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
}
protected void renderDesktop(float delta, ModelBatch modelBatch, PerspectiveCamera cam, Array<ModelInstance> modelInstances) {
modelBatch.begin(cam);
for (ModelInstance instance : modelInstances) {
modelBatch.render(instance);
}
modelBatch.end();
}
@Override
public DeskAppScreen getDeskAppScreen() {
return deskAppScreen;
}
}

View file

@ -0,0 +1,101 @@
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.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.tos4.GDXAppTos4;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", 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;
protected SpriteBatch batch;
protected BitmapFont font;
public AbstractScrollScreen(String background) {
batch = new SpriteBatch();
font = new BitmapFont();
backgroundImage = new Texture(Gdx.files.internal(background));
}
abstract protected String getScrollText();
abstract protected Class<? extends Screen> getNextScreen(GDXAppVrGem4 main);
@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)) {
GDXAppVrGem4.INSTANCE.terminal.selectScreen(getNextScreen(GDXAppVrGem4.INSTANCE));
}
}
}
@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,89 @@
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Screen;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4;
import love.distributedrebirth.gdxapp4d.vrgem4.music.MusicSongType;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class ScreenCredits extends AbstractScrollScreen {
private final String creditsText = String.join("\n",
"Credits;",
"At-Ohm-Allah-to-the-power-of-Four",
"The King of kings",
"Thy Lord of Lords",
"Thee God of Gods",
"Abstract superset over all religions.",
" ",
"There is no god but AtohmAllah^4",
"There is no rule but consent",
"There is no failure but death",
" ",
"One long long day,",
"In a far far, fat-oddly-rounded galaxy,",
"Thy father is near.",
" ",
"Terry A. Davis;",
"- TempleOS",
"- HolyC",
"- Poems",
"- Abba music",
"- Baby fat",
" ",
"ID Tech;",
"- Ultimate DOOM",
"- SIGIL Beast Box",
"- DOOM Eternal",
" ",
"Sanctumwave Music;",
"- (music) TempleOS Hymn Risen",
"- (music) DIVINE INTELLECT",
"- (music) TERRY DAVIS NIGHTWALK",
" ",
"The Self Help Group;",
"- (music) The Self Help-Group Temple OS",
" ",
"PanoramaCircle;",
"- (music) TempleOS 'Waterfowl' poem on real hardware",
" ",
"Willem Abraham Cazander;",
"- http://distributedrebith.love",
" ",
"=============================================",
" ",
"The BASIC Shahada",
"10 PRINT \"THERE IS NO GOD BUT AT_OHM_ALLAH^4\"",
"20 PRINT \"THERE IS NO RULE BUT CONSENT\"",
"30 PRINT \"THERE IS THERE IS NO FAILURE BUT DEATH\"",
"40 PRINT \"TERRY A. DAVIS WAS THE PROPHET OF GOD\"",
"50 PRINT \"TERRY A. DAVIS WAS THE FIRST TRUE MENTAT\"",
"60 PRINT \"TERRY A. DAVIS WAS THE BEST CODER ALIVE\"",
"RUN",
" "
);
public ScreenCredits() {
super("background/doom-credits.png");
}
@Override
protected String getScrollText() {
return creditsText;
}
@Override
protected Class<? extends Screen> getNextScreen(GDXAppVrGem4 main) {
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,37 @@
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.VertexAttributes.Usage;
import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.Model;
import com.badlogic.gdx.graphics.g3d.ModelInstance;
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.utils.Array;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppScreen;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskTopScreen;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class ScreenDesktop1 extends AbstractScreenDesktop {
private Model grid;
public ScreenDesktop1() {
super("Desktop1");
//backgroundImage = new Texture(Gdx.files.internal("background/terrydavis-front.png"));
}
protected void createModel(ModelBuilder modelBuilder, Array<ModelInstance> modelInstances) {
grid = modelBuilder.createLineGrid(33, 33, 1f, 1f, new Material(ColorAttribute.createDiffuse(1f,1f,1f,.1f)), Usage.Position | Usage.Normal);
modelInstances.add(new ModelInstance(grid, 0, 0, 0));
}
@Override
protected void disposeDesktop() {
grid.dispose();
}
}

View file

@ -0,0 +1,37 @@
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.VertexAttributes.Usage;
import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.Model;
import com.badlogic.gdx.graphics.g3d.ModelInstance;
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.utils.Array;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppScreen;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskTopScreen;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class ScreenDesktop2 extends AbstractScreenDesktop {
private Model grid;
public ScreenDesktop2() {
super("Desktop2");
//backgroundImage = new Texture(Gdx.files.internal("background/terrydavis-nose.png"));
}
protected void createModel(ModelBuilder modelBuilder, Array<ModelInstance> modelInstances) {
grid = modelBuilder.createLineGrid(33, 33, 1f, 1f, new Material(ColorAttribute.createDiffuse(1f,1f,1f,.1f)), Usage.Position | Usage.Normal);
modelInstances.add(new ModelInstance(grid, 0, 0, 0));
}
@Override
protected void disposeDesktop() {
grid.dispose();
}
}

View file

@ -0,0 +1,30 @@
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.graphics.VertexAttributes.Usage;
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.utils.ModelBuilder;
import com.badlogic.gdx.utils.Array;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class ScreenDesktop3 extends AbstractScreenDesktop {
private Model grid;
public ScreenDesktop3() {
super("Desktop3");
}
protected void createModel(ModelBuilder modelBuilder, Array<ModelInstance> modelInstances) {
grid = modelBuilder.createLineGrid(33, 33, 1f, 1f, new Material(ColorAttribute.createDiffuse(1f,1f,1f,.1f)), Usage.Position | Usage.Normal);
modelInstances.add(new ModelInstance(grid, 0, 0, 0));
}
@Override
protected void disposeDesktop() {
grid.dispose();
}
}

View file

@ -0,0 +1,169 @@
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.PerspectiveCamera;
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.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.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", 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;
public ScreenDesktop4() {
super("Desktop4");
shader = new UserColorShader();
shader.init();
font = new BitmapFont();
fontCache = new BitmapFontCache(font, false);
spriteBatch = new SpriteBatch();
}
protected void createModel(ModelBuilder modelBuilder, Array<ModelInstance> modelInstances) {
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(1f,1f,1f,.1f)), Usage.Position | Usage.Normal);
modelInstances.add(new ModelInstance(grid, 0, 0, 0));
}
@Override
protected void disposeDesktop() {
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,72 @@
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Screen;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4;
import love.distributedrebirth.gdxapp4d.vrgem4.music.MusicSongType;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", 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() {
super("background/terrydavis-nose.png");
}
@Override
protected String getScrollText() {
return creditsText;
}
@Override
protected Class<? extends Screen> getNextScreen(GDXAppVrGem4 main) {
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,66 @@
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Gdx;
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.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.tos4.GDXAppTos4;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4;
import love.distributedrebirth.gdxapp4d.vrgem4.music.MusicSongType;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class ScreenIntro extends ScreenAdapter {
private Texture backgroundImage;
private float colorDeltaTime = 0f;
private boolean colorPositive = true;
protected SpriteBatch batch;
protected BitmapFont font;
public ScreenIntro() {
batch = new SpriteBatch();
font = new BitmapFont();
backgroundImage = new Texture(Gdx.files.internal("background/temple-os.png"));
}
@Override
public void render(float delta) {
if (colorPositive) {
colorDeltaTime += Gdx.graphics.getDeltaTime()/2;
} else {
colorDeltaTime -= Gdx.graphics.getDeltaTime()/2;
}
if (colorDeltaTime > 1f) {
colorPositive = false;
} else if (colorDeltaTime < 0f) {
colorPositive = true;
}
ScreenUtils.clear(0.333f, colorDeltaTime, colorDeltaTime, 1);
batch.begin();
batch.draw(backgroundImage, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
font.draw(batch, "Tap anywhere to begin!", Gdx.graphics.getWidth()/2 - 73, 33);
batch.end();
if (Gdx.input.isTouched() || Gdx.input.isKeyPressed(Keys.ENTER) || Gdx.input.isKeyPressed(Keys.SPACE)) {
GDXAppVrGem4.INSTANCE.terminal.selectScreen(ScreenIntroMission.class);
dispose();
}
}
@Override
public void show() {
GDXAppVrGem4.INSTANCE.music.play(MusicSongType.INTRO);
}
@Override
public void dispose() {
//batch.dispose();
font.dispose();
backgroundImage.dispose();
}
}

View file

@ -0,0 +1,77 @@
package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Screen;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4;
import love.distributedrebirth.gdxapp4d.vrgem4.music.MusicSongType;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class ScreenIntroMission extends AbstractScrollScreen {
private final String missionText = String.join("\n",
"To a Waterfowl",
" -- by William Cullen Bryant --",
" ",
"Whither, 'midst falling dew,",
"While glow the heavens with the last steps of day,",
"Far, through their rosy depths, dost thou pursue",
"Thy solitary way?",
" ",
"Vainly the fowler's eye",
"Might mark thy distant flight to do thee wrong,",
"As, darkly painted on the crimson sky,",
"Thy figure floats along.",
" ",
"Seek'st thou the plashy brink",
"Of weedy lake, or marge of river wide,",
"Or where the rocking billows rise and sink",
"On the chafed ocean side?",
" ",
"There is a Power whose care",
"Teaches thy way along that pathless coast,--",
"The desert and illimitable air,--",
"Lone wandering, but not lost.",
" ",
"All day thy wings have fann'd",
"At that far height, the cold thin atmosphere:",
"Yet stoop not, weary, to the welcome land,",
"Though the dark night is near.",
" ",
"And soon that toil shall end,",
"Soon shalt thou find a summer home, and rest,",
"And scream among thy fellows; reed shall bend",
"Soon o'er thy sheltered nest.",
" ",
"Thou'rt gone, the abyss of heaven",
"Hath swallowed up thy form; yet, on my heart",
"Deeply hath sunk the lesson thou hast given,",
"And shall not soon depart.",
" ",
"He, who, from zone to zone,",
"Guides through the boundless sky thy certain flight,",
"In the long way that I must tread alone,",
"Will lead my steps aright.",
" "
);
public ScreenIntroMission() {
super("background/terrydavis-nose.png");
}
@Override
protected String getScrollText() {
return missionText;
}
@Override
protected Class<? extends Screen> getNextScreen(GDXAppVrGem4 main) {
return ScreenDesktop1.class;
}
@Override
public void hideScroll() {
GDXAppVrGem4.INSTANCE.music.play(MusicSongType.BACKGROUND);
}
}

View file

@ -0,0 +1,74 @@
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 love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", 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,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