Added more stuff for the standalone installer
This commit is contained in:
@@ -2,6 +2,7 @@ package com.seibel.lod.core;
|
||||
|
||||
import com.formdev.flatlaf.FlatDarkLaf;
|
||||
import com.formdev.flatlaf.FlatLightLaf;
|
||||
import com.formdev.flatlaf.extras.FlatSVGIcon;
|
||||
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
|
||||
import com.seibel.lod.core.jar.DarkModeDetector;
|
||||
import com.seibel.lod.core.jar.BaseJFrame;
|
||||
@@ -9,6 +10,7 @@ import com.seibel.lod.core.jar.JarDependencySetup;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Locale;
|
||||
@@ -38,26 +40,35 @@ public class JarMain {
|
||||
SingletonHandler.finishBinding();
|
||||
System.out.println("WARNING: The standalone jar still work in progress");
|
||||
|
||||
/*
|
||||
To other devs
|
||||
JOptionPane.showMessageDialog(null, "The GUI for the standalone jar isn't made yet\nIf you want to use the mod then put it in your mods folder", "Distant Horizons", JOptionPane.WARNING_MESSAGE);
|
||||
|
||||
For now im just working on linux stuff (so i can use the linux file system when installing the mod)
|
||||
once i got it working ill fix it for windows/mac
|
||||
*/
|
||||
if (!getOperatingSystem().equals(OperatingSystem.LINUX)) {
|
||||
JOptionPane.showMessageDialog(null, "The GUI for the standalone jar isn't made yet\nIf you want to use the mod then put it in your mods folder", "Distant Horizons", JOptionPane.WARNING_MESSAGE);
|
||||
System.out.println("If you want the gui then please use linux for the time being.\nWindows and MacOS support will come later on");
|
||||
return;
|
||||
System.out.println("If you want the installer then please use linux for the time being.\nWindows and MacOS support will come later on");
|
||||
}
|
||||
|
||||
BaseJFrame frame = new BaseJFrame(false, false);
|
||||
String[] optionsToChoose = {"Apple", "Orange", "Banana", "Pineapple", "None of the listed"};
|
||||
BaseJFrame frame = new BaseJFrame(false, false).addExtraButtons();
|
||||
String[] optionsToChoose = {"Apple", "Orange", "Banana", "Pineapple"};
|
||||
JComboBox<String> jTest = new JComboBox<>(optionsToChoose);
|
||||
jTest.setBounds(80, 50, 140, 20);
|
||||
jTest.setBounds(400, 250, 140, 20);
|
||||
frame.add(jTest);
|
||||
jTest.addActionListener(e -> { System.out.println("test"); });
|
||||
|
||||
int logoHeight = 200;
|
||||
int logoWidth = (int) ((double) logoHeight *2.21);
|
||||
JPanel pane = new JPanel() {
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
try {
|
||||
g.drawImage(ImageIO.read(JarMain.accessFile("logo.png")), (frame.getWidth()/2)-(logoWidth/2), 0, logoWidth, logoHeight,this);
|
||||
} catch (Exception e) {e.printStackTrace();}
|
||||
}
|
||||
};
|
||||
pane.setBounds(0, 0, pane.getWidth(), pane.getHeight());
|
||||
|
||||
frame.add(pane);
|
||||
|
||||
|
||||
frame.setLayout(null); // Remove the default layout
|
||||
|
||||
frame.validate(); // Update to add the widgets
|
||||
frame.setVisible(true); // Start the ui
|
||||
@@ -75,18 +86,18 @@ public class JarMain {
|
||||
} else if (os.contains("nix") || os.contains("nux")) {
|
||||
return OperatingSystem.LINUX;
|
||||
} else {
|
||||
return OperatingSystem.NONE;
|
||||
return OperatingSystem.NONE; // If you are the 0.00001% who don't use one of these 3 os's then you get light theme
|
||||
}
|
||||
}
|
||||
|
||||
/** Get a file within the mods resources */
|
||||
public static InputStream accessFile(String resource) {
|
||||
|
||||
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||
// this is the path within the jar file
|
||||
InputStream input = JarMain.class.getResourceAsStream("/resources/" + resource);
|
||||
InputStream input = loader.getResourceAsStream("/resources/" + resource);
|
||||
if (input == null) {
|
||||
// this is how we load file within editor (eg eclipse)
|
||||
input = JarMain.class.getClassLoader().getResourceAsStream(resource);
|
||||
input = loader.getResourceAsStream(resource);
|
||||
}
|
||||
|
||||
return input;
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="700pt"
|
||||
height="700pt"
|
||||
version="1.1"
|
||||
viewBox="0 0 700 700"
|
||||
id="svg4"
|
||||
sodipodi:docname="themeDark.svg"
|
||||
inkscape:version="1.2 (dc2aedaf03, 2022-05-15)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs8" />
|
||||
<sodipodi:namedview
|
||||
id="namedview6"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:document-units="pt"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.79607143"
|
||||
inkscape:cx="466.66667"
|
||||
inkscape:cy="466.03858"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1351"
|
||||
inkscape:window-x="1920"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg4" />
|
||||
<path
|
||||
d="m573.12 450.62c-1.5625-3.2305-4.0781-5.9023-7.207-7.6562-3.1289-1.7539-6.7227-2.5-10.293-2.1445-52.113 7.4141-105.18-3.3867-150.25-30.578-45.07-27.191-79.371-69.105-97.113-118.66-17.738-49.555-17.832-103.71-0.25781-153.33 12.207-34.535 32.625-65.586 59.5-90.477 3.8047-3.4023 5.9336-8.3008 5.8242-13.406-0.10938-5.1055-2.4414-9.9102-6.3867-13.152-3.9453-3.2422-9.1094-4.5977-14.137-3.7148-55.062 7.5039-106.35 32.211-146.54 70.594s-67.223 88.48-77.246 143.14c-10.023 54.656-2.5273 111.09 21.422 161.23 23.949 50.145 63.129 91.441 111.94 118 48.816 26.559 104.77 37.016 159.89 29.883 55.109-7.1328 106.56-31.492 147-69.602 2.6758-2.5234 4.4883-5.8281 5.1797-9.4414 0.69141-3.6133 0.22656-7.3516-1.3281-10.684z"
|
||||
id="path2"
|
||||
style="fill:#003380" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="700pt"
|
||||
height="700pt"
|
||||
version="1.1"
|
||||
viewBox="0 0 700 700"
|
||||
id="svg22"
|
||||
sodipodi:docname="themeLight.svg"
|
||||
inkscape:version="1.2 (dc2aedaf03, 2022-05-15)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs26" />
|
||||
<sodipodi:namedview
|
||||
id="namedview24"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:document-units="pt"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.79607143"
|
||||
inkscape:cx="466.66667"
|
||||
inkscape:cy="466.03858"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1351"
|
||||
inkscape:window-x="1920"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg22" />
|
||||
<g
|
||||
id="g20"
|
||||
style="fill:#55d400">
|
||||
<path
|
||||
d="m472.5 280c0 67.656-54.844 122.5-122.5 122.5s-122.5-54.844-122.5-122.5 54.844-122.5 122.5-122.5 122.5 54.844 122.5 122.5"
|
||||
id="path2"
|
||||
style="fill:#55d400" />
|
||||
<path
|
||||
d="m350 140c4.6406 0 9.0938-1.8438 12.375-5.125s5.125-7.7344 5.125-12.375v-87.5c0-6.2539-3.3359-12.031-8.75-15.156s-12.086-3.125-17.5 0-8.75 8.9023-8.75 15.156v87.5c0 4.6406 1.8438 9.0938 5.125 12.375s7.7344 5.125 12.375 5.125z"
|
||||
id="path4"
|
||||
style="fill:#55d400" />
|
||||
<path
|
||||
d="m226.27 180.95c3.1719 3.7031 7.7461 5.918 12.617 6.1055 4.875 0.1875 9.6016-1.6641 13.051-5.1133 3.4492-3.4492 5.3008-8.1758 5.1133-13.051-0.1875-4.8711-2.4023-9.4453-6.1055-12.617l-61.773-61.949c-4.4414-4.4375-10.91-6.1719-16.973-4.5469-6.0664 1.625-10.801 6.3594-12.426 12.426-1.625 6.0625 0.10938 12.531 4.5469 16.973z"
|
||||
id="path6"
|
||||
style="fill:#55d400" />
|
||||
<path
|
||||
d="m210 280c0-4.6406-1.8438-9.0938-5.125-12.375s-7.7344-5.125-12.375-5.125h-87.5c-6.2539 0-12.031 3.3359-15.156 8.75s-3.125 12.086 0 17.5 8.9023 8.75 15.156 8.75h87.5c4.6406 0 9.0938-1.8438 12.375-5.125s5.125-7.7344 5.125-12.375z"
|
||||
id="path8"
|
||||
style="fill:#55d400" />
|
||||
<path
|
||||
d="m226.27 379.05-61.949 61.773c-3.7031 3.1719-5.9141 7.7461-6.1016 12.617-0.19141 4.8711 1.6641 9.6016 5.1094 13.051 3.4492 3.4453 8.1797 5.3008 13.051 5.1133 4.8711-0.19141 9.4453-2.4023 12.617-6.1055l61.949-61.949c3.8594-4.5078 5.1719-10.66 3.4922-16.348-1.6836-5.6875-6.1328-10.137-11.82-11.816-5.6875-1.6836-11.84-0.37109-16.348 3.4883z"
|
||||
id="path10"
|
||||
style="fill:#55d400" />
|
||||
<path
|
||||
d="m350 420c-4.6406 0-9.0938 1.8438-12.375 5.125s-5.125 7.7344-5.125 12.375v87.5c0 6.2539 3.3359 12.031 8.75 15.156s12.086 3.125 17.5 0 8.75-8.9023 8.75-15.156v-87.5c0-4.6406-1.8438-9.0938-5.125-12.375s-7.7344-5.125-12.375-5.125z"
|
||||
id="path12"
|
||||
style="fill:#55d400" />
|
||||
<path
|
||||
d="m473.73 379.05c-4.5078-3.8594-10.66-5.1719-16.348-3.4922-5.6875 1.6836-10.137 6.1328-11.82 11.82-1.6797 5.6875-0.36719 11.84 3.4922 16.348l61.949 61.949c4.5039 3.8555 10.656 5.1719 16.348 3.4883 5.6875-1.6797 10.137-6.1289 11.816-11.816 1.6836-5.6914 0.36719-11.844-3.4883-16.348z"
|
||||
id="path14"
|
||||
style="fill:#55d400" />
|
||||
<path
|
||||
d="m595 262.5h-87.5c-6.2539 0-12.031 3.3359-15.156 8.75s-3.125 12.086 0 17.5 8.9023 8.75 15.156 8.75h87.5c6.2539 0 12.031-3.3359 15.156-8.75s3.125-12.086 0-17.5-8.9023-8.75-15.156-8.75z"
|
||||
id="path16"
|
||||
style="fill:#55d400" />
|
||||
<path
|
||||
d="m461.3 186.2c4.6523 0.027343 9.1211-1.7969 12.426-5.0742l61.949-61.949c3.8555-4.5078 5.1719-10.66 3.4883-16.348-1.6797-5.6875-6.1289-10.137-11.816-11.816-5.6914-1.6836-11.844-0.37109-16.348 3.4883l-61.949 61.773c-3.3086 3.2852-5.1719 7.75-5.1758 12.414-0.003906 4.6602 1.8516 9.1289 5.1562 12.418 3.3047 3.2891 7.7812 5.1211 12.445 5.0938z"
|
||||
id="path18"
|
||||
style="fill:#55d400" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" standalone="yes"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
|
||||
<!-- No icon texture for DH -->
|
||||
|
||||
<rect width="50" height="50" x="0" y="0" style="fill:#0000FF" />
|
||||
<rect width="50" height="50" x="50" y="50" style="fill:#0000FF" />
|
||||
<rect width="50" height="50" x="50" y="0" style="fill:#000000" />
|
||||
<rect width="50" height="50" x="0" y="50" style="fill:#000000" />
|
||||
</svg>
|
||||
|
||||
|
After Width: | Height: | Size: 430 B |
Binary file not shown.
|
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 241 KiB |
Reference in New Issue
Block a user