Inceptum/launcher-imgui/src/main/java/io/gitlab/jfronny/inceptum/imgui/window/AboutWindow.java

44 lines
1.6 KiB
Java
Raw Normal View History

2022-09-04 21:21:24 +02:00
package io.gitlab.jfronny.inceptum.imgui.window;
2021-10-28 21:31:51 +02:00
import imgui.ImGui;
2022-09-04 21:21:24 +02:00
import io.gitlab.jfronny.inceptum.common.BuildMetadata;
import io.gitlab.jfronny.inceptum.common.Utils;
import io.gitlab.jfronny.inceptum.launcher.LauncherEnv;
2021-12-11 15:06:17 +01:00
import java.net.URI;
import java.net.URISyntaxException;
2021-10-28 21:31:51 +02:00
public class AboutWindow extends Window {
public AboutWindow() {
super("About");
}
@Override
public void draw() {
2023-01-29 18:39:17 +01:00
ImGui.text("Inceptum " + BuildMetadata.VERSION + " Copyright (C) 2021-2023 JFronny");
2021-10-28 21:31:51 +02:00
ImGui.text("This program comes with ABSOLUTELY NO WARRANTY.");
ImGui.text("This is free software, and you are welcome to redistribute it under certain conditions.");
2021-12-11 15:06:17 +01:00
ImGui.separator();
2022-09-04 21:21:24 +02:00
int vm = Runtime.version().feature();
if (!BuildMetadata.IS_PUBLIC) {
ImGui.text("This is a custom build. No support will be provided");
} else if (BuildMetadata.VM_VERSION != vm) {
ImGui.text("This build was designed for Java " + BuildMetadata.VM_VERSION + ", but you are using Java " + vm + ". No support will be provided");
} else {
2021-12-11 15:06:17 +01:00
try {
ImGui.text("For support, you can head to my ");
ImGui.sameLine();
if (ImGui.button("Matrix")) {
Utils.openWebBrowser(new URI("https://matrix.to/#/%23jfronny%3Amatrix.org"));
}
ImGui.sameLine();
ImGui.text(" space");
} catch (URISyntaxException e) {
2022-09-04 21:21:24 +02:00
LauncherEnv.showError("Could not complete task", e);
2021-12-11 15:06:17 +01:00
}
}
2021-10-28 21:31:51 +02:00
}
}