added check for updates to options

This commit is contained in:
Downforce Agent 2024-07-12 17:10:58 -05:00
parent eccc896e89
commit 83efce8f3f
2 changed files with 22 additions and 10 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Waldorf">
<grid id="27dc6" binding="frameContainer" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="frameContainer" layout-manager="GridLayoutManager" row-count="7" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="25" bottom="10" right="25"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
@ -16,7 +16,7 @@
<children>
<component id="3d88f" class="javax.swing.JButton" binding="okbtn">
<constraints>
<grid row="5" column="2" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="6" column="2" row-span="1" col-span="1" vsize-policy="2" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-2271221"/>
@ -39,7 +39,7 @@
</component>
<component id="50d13" class="javax.swing.JButton" binding="cancelbtn">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="2" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-2271221"/>
@ -52,7 +52,7 @@
</component>
<component id="252b3" class="javax.swing.JButton" binding="resetbtn">
<constraints>
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="2" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-2271221"/>
@ -173,6 +173,20 @@
</component>
</children>
</grid>
<component id="73ca5" class="javax.swing.JCheckBox" binding="checkUpdatesToggle">
<constraints>
<grid row="5" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<focusPainted value="false"/>
<font name="Exo 2"/>
<foreground color="-1"/>
<label value="Automatically check for updates on startup"/>
<opaque value="false"/>
<rolloverEnabled value="false"/>
<text value="Automatically check for updates on startup"/>
</properties>
</component>
</children>
</grid>
</form>

View File

@ -18,8 +18,6 @@
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -28,7 +26,6 @@ import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import static javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE;
@ -43,6 +40,7 @@ public class Waldorf implements ActionListener {
private JButton dwnSDKbtn;
private JButton dwnARCbtn;
private JButton fOutpathChangebtn;
private JCheckBox checkUpdatesToggle;
MissPiggy invoker;
private String tOutPath = Main.outpath;
@ -57,7 +55,7 @@ public class Waldorf implements ActionListener {
} catch (IOException e) {
System.out.println("ERROR: Failed to find /resources/titleIcon.png. Window will not have an icon.");
}
frame.setSize(600, 200); // 1280 800
frame.setSize(600, 300); // 1280 800
frame.setMinimumSize(new Dimension(200,100));
frame.setTitle("Options");
frame.setResizable(false);
@ -70,13 +68,12 @@ public class Waldorf implements ActionListener {
okbtn.addActionListener(this);
resetbtn.addActionListener(this);
bOpenFolder.addActionListener(this);
dwnARCbtn.addActionListener(this);
dwnSDKbtn.addActionListener(this);
fOutpathChangebtn.addActionListener(this);
fOutpath.setText(Main.outpath);
checkUpdatesToggle.setSelected(Main.checkUpdates);
frame.setVisible(true);
frame.addWindowListener(new WindowAdapter() {
@ -97,6 +94,7 @@ public class Waldorf implements ActionListener {
} else
if (actionEvent.getSource() == okbtn) {
Main.outpath = tOutPath;
Main.checkUpdates = checkUpdatesToggle.isSelected();
Main.writeConf();
Main.loadConf();