|
25 | 25 | import lol.hyper.customlauncher.invasiontracker.InvasionTracker;
|
26 | 26 | import lol.hyper.customlauncher.login.LoginHandler;
|
27 | 27 | import lol.hyper.customlauncher.login.LoginRequest;
|
| 28 | +import lol.hyper.customlauncher.ttrupdater.TTRUpdater; |
28 | 29 | import org.json.JSONObject;
|
29 | 30 |
|
30 | 31 | import javax.swing.*;
|
31 | 32 | import java.awt.*;
|
32 | 33 | import java.awt.event.MouseAdapter;
|
33 | 34 | import java.awt.event.MouseEvent;
|
| 35 | +import java.nio.file.Paths; |
34 | 36 | import java.util.HashMap;
|
35 | 37 |
|
36 | 38 | public class MainWindow extends JFrame {
|
@@ -112,6 +114,19 @@ public MainWindow() {
|
112 | 114 | new Dimension(300, fieldOfficesButton.getMinimumSize().height));
|
113 | 115 | panel.add(fieldOfficesButton);
|
114 | 116 |
|
| 117 | + // check for updates button |
| 118 | + JButton ttrUpdateButton = new JButton("Check TTR Updates"); |
| 119 | + ttrUpdateButton.addActionListener( |
| 120 | + e -> { |
| 121 | + // we do this on another thread since it won't properly update the gui |
| 122 | + Thread t1 = new Thread(() -> new TTRUpdater("Updater", Paths.get(Main.TTR_INSTALL_DIR.getAbsolutePath()))); |
| 123 | + t1.start(); |
| 124 | + }); |
| 125 | + ttrUpdateButton.setAlignmentX(Component.CENTER_ALIGNMENT); |
| 126 | + ttrUpdateButton.setMaximumSize( |
| 127 | + new Dimension(300, ttrUpdateButton.getMinimumSize().height)); |
| 128 | + panel.add(ttrUpdateButton); |
| 129 | + |
115 | 130 |
|
116 | 131 | // game status
|
117 | 132 | ttrStatus = new JLabel("Fetching Status...");
|
|
0 commit comments