2121import java .util .concurrent .ExecutionException ;
2222import java .util .zip .ZipEntry ;
2323import java .util .zip .ZipInputStream ;
24- import javax .swing .ImageIcon ;
25- import javax .swing .JFileChooser ;
26- import javax .swing .JOptionPane ;
27- import javax .swing .SwingWorker ;
24+ import javax .swing .*;
25+
2826import net .fabricmc .installer .Main ;
2927import net .fabricmc .installer .util .MetaHandler ;
3028import net .fabricmc .installer .util .Reference ;
3634 * @author ims
3735 */
3836@ SuppressWarnings ("serial" )
39- public class NewInstaller extends javax . swing . JFrame {
37+ public class NewInstaller extends JFrame {
4038
4139 private static boolean dark = false ;
4240 private boolean installAsMod ;
4341 private String outdatedPlaceholder = "Warning: We have ended support for <version>." ;
42+ private String snapshotPlaceholder = "Warning: <version> is a snapshot build and may" ;
4443 private String BASE_URL = "https://raw.githubusercontent.com/IrisShaders/Iris-Installer-Files/master/" ;
4544 private boolean finishedSuccessfulInstall ;
4645 private InstallerMeta .Version selectedVersion ;
@@ -231,9 +230,9 @@ private void initComponents() {
231230
232231 setDefaultCloseOperation (javax .swing .WindowConstants .EXIT_ON_CLOSE );
233232 setIconImage (new ImageIcon (Objects .requireNonNull (Utils .class .getClassLoader ().getResource ("iris_profile_icon.png" ))).getImage ());
234- setMaximumSize (new java .awt .Dimension (480 , 550 ));
235- setMinimumSize (new java .awt .Dimension (480 , 550 ));
236- setPreferredSize (new java .awt .Dimension (480 , 550 ));
233+ setMaximumSize (new java .awt .Dimension (480 , 600 ));
234+ setMinimumSize (new java .awt .Dimension (480 , 600 ));
235+ setPreferredSize (new java .awt .Dimension (480 , 600 ));
237236 setResizable (false );
238237 getContentPane ().setLayout (new java .awt .GridBagLayout ());
239238
@@ -403,8 +402,8 @@ public void mouseClicked(java.awt.event.MouseEvent evt) {
403402 installButton .setFont (installButton .getFont ().deriveFont ((float )16 ));
404403 installButton .setText ("Install" );
405404 installButton .setToolTipText ("" );
406- installButton .setMargin (new java .awt .Insets (10 , 65 , 10 , 65 ));
407- installButton .setMaximumSize (new java .awt .Dimension (300 , 45 ));
405+ installButton .setMargin (new java .awt .Insets (10 , 70 , 10 , 70 ));
406+ installButton .setMaximumSize (new java .awt .Dimension (320 , 45 ));
408407 installButton .setMinimumSize (new java .awt .Dimension (173 , 45 ));
409408 installButton .addMouseListener (new java .awt .event .MouseAdapter () {
410409 public void mouseClicked (java .awt .event .MouseEvent evt ) {
@@ -444,6 +443,13 @@ private void gameVersionListItemStateChanged(java.awt.event.ItemEvent evt) {//GE
444443 outdatedText1 .setText (outdatedPlaceholder .replace ("<version>" , selectedVersion .name ));
445444 betaSelection .setVisible (false );
446445 outdatedText1 .setVisible (true );
446+ outdatedText2 .setText ("The Iris version you get will most likely be outdated." );
447+ outdatedText2 .setVisible (true );
448+ } else if (selectedVersion .snapshot ) {
449+ outdatedText1 .setText (snapshotPlaceholder .replace ("<version>" , selectedVersion .name ));
450+ betaSelection .setVisible (false );
451+ outdatedText1 .setVisible (true );
452+ outdatedText2 .setText ("lose support at any time." );
447453 outdatedText2 .setVisible (true );
448454 } else {
449455 if (INSTALLER_META .hasBeta ()) {
@@ -471,7 +477,7 @@ private void installButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIR
471477 String profileName = installAsMod ? "Fabric Loader " : "Iris & Sodium for " ;
472478 VanillaLauncherIntegration .Icon profileIcon = installAsMod ? VanillaLauncherIntegration .Icon .FABRIC : VanillaLauncherIntegration .Icon .IRIS ;
473479 String loaderVersion = installAsMod ? Main .LOADER_META .getLatestVersion (false ).getVersion () : Utils .readTextFile (loaderVersionUrl );
474- boolean success = VanillaLauncherIntegration .installToLauncher (getVanillaGameDir (), getInstallDir (), profileName + selectedVersion .name , selectedVersion .name , loaderName , loaderVersion , profileIcon );
480+ boolean success = VanillaLauncherIntegration .installToLauncher (this , getVanillaGameDir (), getInstallDir (), profileName + selectedVersion .name , selectedVersion .name , loaderName , loaderVersion , profileIcon );
475481 if (!success ) {
476482 System .out .println ("Failed to install to launcher, canceling!" );
477483 return ;
@@ -489,6 +495,8 @@ private void installButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIR
489495 }
490496
491497 installButton .setText ("Downloading..." );
498+ //installButton.setMargin(new java.awt.Insets(10, 90, 10, 90));
499+
492500 installButton .setEnabled (false );
493501 progressBar .setForeground (new Color (76 , 135 , 200 ));
494502 progressBar .setValue (0 );
@@ -606,6 +614,8 @@ private void installButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIR
606614
607615 if (installSuccess ) {
608616 installButton .setText ("Completed!" );
617+ //installButton.setMargin(new java.awt.Insets(10, 80, 10, 80));
618+
609619 progressBar .setForeground (new Color (39 , 195 , 75 ));
610620 installButton .setEnabled (true );
611621 finishedSuccessfulInstall = true ;
0 commit comments