we're getting there
This commit is contained in:
parent
e4448614dd
commit
e23a44b194
130
src/Kermit.java
130
src/Kermit.java
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.text.StyleConstants;
|
import javax.swing.text.StyleConstants;
|
||||||
|
import java.awt.*;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -31,7 +32,8 @@ public class Kermit implements ActionListener {
|
||||||
SDK_FAILURE(3),
|
SDK_FAILURE(3),
|
||||||
WHAT_OS(4),
|
WHAT_OS(4),
|
||||||
EXPORT_LOCATION(5),
|
EXPORT_LOCATION(5),
|
||||||
DONE(6);
|
IMPORT_LOCATION(6),
|
||||||
|
DONE(7);
|
||||||
|
|
||||||
public final int value;
|
public final int value;
|
||||||
|
|
||||||
|
@ -46,12 +48,27 @@ public class Kermit implements ActionListener {
|
||||||
JButton button3 = new JButton("Cancel");
|
JButton button3 = new JButton("Cancel");
|
||||||
JButton button4 = new JButton("Back");
|
JButton button4 = new JButton("Back");
|
||||||
JTextPane dialogText = new JTextPane();
|
JTextPane dialogText = new JTextPane();
|
||||||
|
JRadioButton buttonCompat = new JRadioButton("Compatibility (for consoles)");
|
||||||
|
JRadioButton buttonFast = new JRadioButton("Fast Mode (for Vita3K emulator)");
|
||||||
|
ButtonGroup radg1 = new ButtonGroup();
|
||||||
Pages page = Pages.AGREEMENT;
|
Pages page = Pages.AGREEMENT;
|
||||||
javax.swing.text.StyledDocument document = dialogText.getStyledDocument();
|
javax.swing.text.StyledDocument document = dialogText.getStyledDocument();
|
||||||
javax.swing.text.SimpleAttributeSet align= new javax.swing.text.SimpleAttributeSet();
|
javax.swing.text.SimpleAttributeSet align= new javax.swing.text.SimpleAttributeSet();
|
||||||
|
|
||||||
public void setup(File fConf) { //File variable is redundant. unused
|
public void setup(File fConf) { //File variable is redundant. unused
|
||||||
// todo Disable MissPiggy
|
// todo Disable MissPiggy
|
||||||
|
|
||||||
|
frame.getContentPane().setBackground(Color.WHITE);
|
||||||
|
radg1.add(buttonCompat);
|
||||||
|
radg1.add(buttonFast);
|
||||||
|
|
||||||
|
button.addActionListener(this);
|
||||||
|
button2.addActionListener(this);
|
||||||
|
button3.addActionListener(this);
|
||||||
|
button4.addActionListener(this);
|
||||||
|
buttonCompat.addActionListener(this);
|
||||||
|
buttonFast.addActionListener(this);
|
||||||
|
|
||||||
changePage(Pages.AGREEMENT);
|
changePage(Pages.AGREEMENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,13 +77,20 @@ public class Kermit implements ActionListener {
|
||||||
if (actionEvent.getSource() == button2){
|
if (actionEvent.getSource() == button2){
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
} else if (actionEvent.getSource() == button){
|
} else if (actionEvent.getSource() == button){
|
||||||
|
//frame.removeAll(); freezes??
|
||||||
switch (page) {
|
switch (page) {
|
||||||
case AGREEMENT:
|
case AGREEMENT:
|
||||||
frame.remove(button);
|
button.setVisible(false);frame.remove(button);
|
||||||
frame.remove(button2);
|
button2.setVisible(false);frame.remove(button2);
|
||||||
|
dialogText.setVisible(false);frame.remove(dialogText);
|
||||||
changePage(Pages.EXPORT_MODE);
|
changePage(Pages.EXPORT_MODE);
|
||||||
break;
|
break;
|
||||||
case EXPORT_MODE:
|
case EXPORT_MODE:
|
||||||
|
button.setVisible(false);frame.remove(button);
|
||||||
|
button2.setVisible(false);frame.remove(button3);
|
||||||
|
dialogText.setVisible(false);frame.remove(dialogText);
|
||||||
|
buttonCompat.setVisible(false);frame.remove(buttonCompat);
|
||||||
|
buttonFast.setVisible(false);frame.remove(buttonFast);
|
||||||
if (Main.repatch) {changePage(Pages.SDK_INSTALL);} else {changePage(Pages.EXPORT_LOCATION);}
|
if (Main.repatch) {changePage(Pages.SDK_INSTALL);} else {changePage(Pages.EXPORT_LOCATION);}
|
||||||
break;
|
break;
|
||||||
case SDK_INSTALL:
|
case SDK_INSTALL:
|
||||||
|
@ -76,6 +100,9 @@ public class Kermit implements ActionListener {
|
||||||
case WHAT_OS:
|
case WHAT_OS:
|
||||||
break;
|
break;
|
||||||
case EXPORT_LOCATION:
|
case EXPORT_LOCATION:
|
||||||
|
changePage(Pages.IMPORT_LOCATION);
|
||||||
|
break;
|
||||||
|
case IMPORT_LOCATION:
|
||||||
changePage(Pages.DONE);
|
changePage(Pages.DONE);
|
||||||
break;
|
break;
|
||||||
case DONE:
|
case DONE:
|
||||||
|
@ -88,6 +115,36 @@ public class Kermit implements ActionListener {
|
||||||
throw new UnsupportedOperationException("ERROR: Undefined behavior in Kermit's event listener. Get a programmer!");
|
throw new UnsupportedOperationException("ERROR: Undefined behavior in Kermit's event listener. Get a programmer!");
|
||||||
//JOptionPane OhShit = new JOptionPane.showMessageDialog(null, "Fuck");
|
//JOptionPane OhShit = new JOptionPane.showMessageDialog(null, "Fuck");
|
||||||
}
|
}
|
||||||
|
} else if (actionEvent.getSource() == button4){
|
||||||
|
//frame.removeAll(); freezes??
|
||||||
|
switch (page) { // todo remove elements when going to previous page
|
||||||
|
case EXPORT_MODE:
|
||||||
|
changePage(Pages.AGREEMENT);
|
||||||
|
break;
|
||||||
|
case SDK_INSTALL:
|
||||||
|
changePage(Pages.EXPORT_MODE);
|
||||||
|
break;
|
||||||
|
case SDK_FAILURE:
|
||||||
|
break;
|
||||||
|
case WHAT_OS:
|
||||||
|
changePage(Pages.SDK_INSTALL);
|
||||||
|
break;
|
||||||
|
case EXPORT_LOCATION:
|
||||||
|
if (Main.repatch) {changePage(Pages.WHAT_OS);} else {changePage(Pages.EXPORT_MODE);}
|
||||||
|
break;
|
||||||
|
case IMPORT_LOCATION:
|
||||||
|
changePage(Pages.EXPORT_LOCATION);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new UnsupportedOperationException("ERROR: Undefined behavior in Kermit's event listener. Get a programmer!");
|
||||||
|
//JOptionPane OhShit = new JOptionPane.showMessageDialog(null, "Fuck");
|
||||||
|
}
|
||||||
|
} else if (actionEvent.getSource() == buttonCompat) {
|
||||||
|
Main.repatch = true;
|
||||||
|
button.setEnabled(true);
|
||||||
|
} else if (actionEvent.getSource() == buttonFast) {
|
||||||
|
Main.repatch = false;
|
||||||
|
button.setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,14 +153,15 @@ public class Kermit implements ActionListener {
|
||||||
case AGREEMENT:
|
case AGREEMENT:
|
||||||
page = Pages.AGREEMENT;
|
page = Pages.AGREEMENT;
|
||||||
|
|
||||||
|
button.setVisible(true);
|
||||||
button.setBounds(292, 343, 300, 30);
|
button.setBounds(292, 343, 300, 30);
|
||||||
button.addActionListener(this);
|
|
||||||
frame.add(button);
|
frame.add(button);
|
||||||
|
|
||||||
|
button2.setVisible(true);
|
||||||
button2.setBounds(0, 343, 292, 30);
|
button2.setBounds(0, 343, 292, 30);
|
||||||
button2.addActionListener(this);
|
|
||||||
frame.add(button2);
|
frame.add(button2);
|
||||||
|
|
||||||
|
dialogText.setVisible(true);
|
||||||
dialogText.setHighlighter(null);
|
dialogText.setHighlighter(null);
|
||||||
dialogText.getCaret().setVisible(false);
|
dialogText.getCaret().setVisible(false);
|
||||||
dialogText.setFocusable(false);
|
dialogText.setFocusable(false);
|
||||||
|
@ -130,29 +188,36 @@ public class Kermit implements ActionListener {
|
||||||
case EXPORT_MODE:
|
case EXPORT_MODE:
|
||||||
page = Pages.EXPORT_MODE;
|
page = Pages.EXPORT_MODE;
|
||||||
|
|
||||||
|
button.setVisible(true);
|
||||||
|
button.setEnabled(false);
|
||||||
button.setBounds(292, 343, 300, 30);
|
button.setBounds(292, 343, 300, 30);
|
||||||
button.addActionListener(this);
|
|
||||||
frame.add(button);
|
frame.add(button);
|
||||||
|
|
||||||
button2.setBounds(0, 343, 292, 30);
|
button3.setVisible(true);
|
||||||
button2.addActionListener(this);
|
button3.setBounds(0, 343, 292, 30);
|
||||||
frame.add(button2);
|
frame.add(button3);
|
||||||
|
|
||||||
|
dialogText.setVisible(true);
|
||||||
dialogText.setHighlighter(null);
|
dialogText.setHighlighter(null);
|
||||||
dialogText.getCaret().setVisible(false);
|
dialogText.getCaret().setVisible(false);
|
||||||
dialogText.setFocusable(false);
|
dialogText.setFocusable(false);
|
||||||
dialogText.setBounds(0, 0, 592, 343);
|
dialogText.setBounds(0, 40, 592, 150);
|
||||||
//dialogText.setAlignmentX(JComponent.CENTER_ALIGNMENT);
|
|
||||||
//dialogText.setAlignmentY(JComponent.CENTER_ALIGNMENT);
|
|
||||||
StyleConstants.setAlignment(align, StyleConstants.ALIGN_CENTER);
|
StyleConstants.setAlignment(align, StyleConstants.ALIGN_CENTER);
|
||||||
document.setParagraphAttributes(0, document.getLength(), align, false);
|
document.setParagraphAttributes(0, document.getLength(), align, false);
|
||||||
//dialogText.setText("Aww Fiddlesticks, what now?");
|
dialogText.setText("Please choose how Firestar will deploy your mods.\n\n" +
|
||||||
dialogText.setText("WELCOME TO FIRESTAR\n\n" +
|
"Compatibility mode requires software from the PSVita SDK, but works on real hardware.\n" +
|
||||||
"This initial setup guide will help you prepare your Playstation Vita, Playstation TV, or Vita3K emulator to play WipEout mods. You will be asked a series of questions to help Firestar decide the most optimal installation method for you.\n\n" +
|
"Fast mode is easiest, but won't work on FAT32/exFAT drives like what the Vita uses.");
|
||||||
"If you encounter any issues while using Firestar you may contact the author at bonkmaykr@screwgravity.net\n\n" +
|
|
||||||
"DISCLAIMER: This program is free software licensed under the GNU General Public License version 3.0. You may share this program and it's source code so long as you extend the same rights to others. The developers of this software are never responsible for any damage to your game console and Firestar is provided to you without any warranty or legal guarantee. By using Firestar, you agree to these terms. For more information, visit https://www.gnu.org/licenses/gpl-3.0.en.html");
|
|
||||||
frame.add(dialogText);
|
frame.add(dialogText);
|
||||||
|
|
||||||
|
buttonCompat.setBounds(40, 200, 300, 25);
|
||||||
|
buttonFast.setBounds(40, 230, 300, 25);
|
||||||
|
buttonCompat.setBackground(Color.WHITE);
|
||||||
|
buttonFast.setBackground(Color.WHITE);
|
||||||
|
buttonCompat.setVisible(true);
|
||||||
|
buttonFast.setVisible(true);
|
||||||
|
frame.add(buttonCompat);
|
||||||
|
frame.add(buttonFast);
|
||||||
|
|
||||||
frame.setSize(600, 400);
|
frame.setSize(600, 400);
|
||||||
frame.setTitle("Initial Setup");
|
frame.setTitle("Initial Setup");
|
||||||
frame.setAlwaysOnTop(true);
|
frame.setAlwaysOnTop(true);
|
||||||
|
@ -163,6 +228,34 @@ public class Kermit implements ActionListener {
|
||||||
break;
|
break;
|
||||||
case SDK_INSTALL:
|
case SDK_INSTALL:
|
||||||
page = Pages.SDK_INSTALL;
|
page = Pages.SDK_INSTALL;
|
||||||
|
|
||||||
|
button.setVisible(true);
|
||||||
|
button.setBounds(292, 343, 300, 30);
|
||||||
|
button.addActionListener(this);
|
||||||
|
frame.add(button);
|
||||||
|
|
||||||
|
button3.setVisible(true);
|
||||||
|
button3.setBounds(0, 343, 292, 30);
|
||||||
|
button3.addActionListener(this);
|
||||||
|
frame.add(button3);
|
||||||
|
|
||||||
|
dialogText.setVisible(true);
|
||||||
|
dialogText.setHighlighter(null);
|
||||||
|
dialogText.getCaret().setVisible(false);
|
||||||
|
dialogText.setFocusable(false);
|
||||||
|
dialogText.setBounds(0, 40, 592, 300);
|
||||||
|
StyleConstants.setAlignment(align, StyleConstants.ALIGN_CENTER);
|
||||||
|
document.setParagraphAttributes(0, document.getLength(), align, false);
|
||||||
|
dialogText.setText("it works!");
|
||||||
|
frame.add(dialogText);
|
||||||
|
|
||||||
|
frame.setSize(600, 400);
|
||||||
|
frame.setTitle("Initial Setup");
|
||||||
|
frame.setAlwaysOnTop(true);
|
||||||
|
frame.setDefaultCloseOperation(0);
|
||||||
|
frame.setResizable(false);
|
||||||
|
frame.setLayout(null);
|
||||||
|
frame.setVisible(true);
|
||||||
break;
|
break;
|
||||||
case SDK_FAILURE:
|
case SDK_FAILURE:
|
||||||
page = Pages.SDK_FAILURE;
|
page = Pages.SDK_FAILURE;
|
||||||
|
@ -173,6 +266,9 @@ public class Kermit implements ActionListener {
|
||||||
case EXPORT_LOCATION:
|
case EXPORT_LOCATION:
|
||||||
page = Pages.EXPORT_LOCATION;
|
page = Pages.EXPORT_LOCATION;
|
||||||
break;
|
break;
|
||||||
|
case IMPORT_LOCATION:
|
||||||
|
page = Pages.IMPORT_LOCATION;
|
||||||
|
break;
|
||||||
case DONE:
|
case DONE:
|
||||||
page = Pages.DONE;
|
page = Pages.DONE;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user