Add support URLs to AboutWindow

This commit is contained in:
Johannes Frohnmeyer 2021-12-11 15:06:17 +01:00
parent 3c3474c6ab
commit 2d47f2e45f
Signed by: Johannes
GPG Key ID: E76429612C2929F4
1 changed files with 30 additions and 1 deletions

View File

@ -1,7 +1,12 @@
package io.gitlab.jfronny.inceptum.windows;
import imgui.ImGui;
import io.gitlab.jfronny.inceptum.Inceptum;
import io.gitlab.jfronny.inceptum.util.MetaHolder;
import io.gitlab.jfronny.inceptum.util.Utils;
import java.net.URI;
import java.net.URISyntaxException;
public class AboutWindow extends Window {
public AboutWindow() {
@ -10,8 +15,32 @@ public class AboutWindow extends Window {
@Override
public void draw() {
ImGui.text("Inceptum " + MetaHolder.VERSION.version + " Copyright (C) 2021 JFronny");
ImGui.text("Inceptum " + MetaHolder.VERSION.version + " (" + MetaHolder.VERSION.flavor + ") Copyright (C) 2021 JFronny");
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.");
ImGui.separator();
if (!MetaHolder.VERSION.isPublic) ImGui.text("This is a custom build. No support will be provided");
else if (!MetaHolder.VERSION.jvm.equals(Runtime.version().feature())) ImGui.text("This build was designed for Java " + MetaHolder.VERSION.jvm + ", but you are using Java " + Runtime.version().feature() + ". No support will be provided");
else {
try {
ImGui.text("For support, you can head to my ");
ImGui.sameLine();
if (ImGui.button("Discord")) {
Utils.openWebBrowser(new URI("https://discord.gg/UjhHBqt"));
}
ImGui.sameLine();
ImGui.text("guild or");
ImGui.sameLine();
if (ImGui.button("Matrix")) {
Utils.openWebBrowser(new URI("https://matrix.to/#/%23jfronny%3Amatrix.org"));
}
ImGui.sameLine();
ImGui.text(" space");
} catch (URISyntaxException e) {
Inceptum.showError("Could not complete task", e);
}
}
}
}