about screen

This commit is contained in:
Downforce Agent 2024-04-13 10:04:35 -05:00
parent fb7620bcff
commit 10b4a91515
8 changed files with 140 additions and 3 deletions

View File

@ -3,7 +3,9 @@
<component name="MaterialThemeProjectNewConfig"> <component name="MaterialThemeProjectNewConfig">
<option name="metadata"> <option name="metadata">
<MTProjectMetadataState> <MTProjectMetadataState>
<option name="userId" value="-52a30455:18ecc46f11f:-7fff" /> <option name="migrated" value="true" />
<option name="pristineConfig" value="false" />
<option name="userId" value="-52a30455:18ecc46f11f:-7ffe" />
</MTProjectMetadataState> </MTProjectMetadataState>
</option> </option>
</component> </component>

BIN
resources/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

BIN
resources/logo_about.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -268,6 +268,7 @@ public class Kermit implements ActionListener {
frame.setDefaultCloseOperation(0); frame.setDefaultCloseOperation(0);
frame.setResizable(false); frame.setResizable(false);
frame.setLayout(null); frame.setLayout(null);
frame.setLocationRelativeTo(null);
frame.setVisible(true); frame.setVisible(true);
break; break;
case SDK_INSTALL: case SDK_INSTALL:

View File

@ -28,7 +28,7 @@ import javax.swing.*;
public class Main { public class Main {
// Build Information // Build Information
public static final String vstr = "debug"; public static final String vstr = "PREALPHA";
public static final String vcode = "Natasha"; public static final String vcode = "Natasha";
public static final int vint = 0; public static final int vint = 0;
@ -57,6 +57,7 @@ public class Main {
// license string // license string
System.out.printf("FIRESTAR MOD MANAGER for WipEout 2048\nversion " + vstr + " (codename " + vcode + ")\n" + System.out.printf("FIRESTAR MOD MANAGER for WipEout 2048\nversion " + vstr + " (codename " + vcode + ")\n" +
"JVM host appears to be " + System.getProperty("os.name") + "JVM host appears to be " + System.getProperty("os.name") +
"\nRunning from " + System.getProperty("user.dir") +
"\nCopyright (C) 2024 bonkmaykr\n\nThis program is free software: you can redistribute it and/or modify\n" + "\nCopyright (C) 2024 bonkmaykr\n\nThis program is free software: you can redistribute it and/or modify\n" +
"it under the terms of the GNU General Public License as published by\n" + "it under the terms of the GNU General Public License as published by\n" +
"the Free Software Foundation, either version 3 of the License, or\n" + "the Free Software Foundation, either version 3 of the License, or\n" +

View File

@ -109,6 +109,7 @@ public class MissPiggy implements ActionListener {
frame.setResizable(true); frame.setResizable(true);
frame.setDefaultCloseOperation(EXIT_ON_CLOSE); frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
frame.setLayout(new GridLayout()); frame.setLayout(new GridLayout());
frame.setLocationRelativeTo(null);
frame.setVisible(true); frame.setVisible(true);
} }
@ -141,7 +142,8 @@ public class MissPiggy implements ActionListener {
if (actionEvent.getSource() == fileMenu.getItem(0)) {deployModGUI();} else if (actionEvent.getSource() == fileMenu.getItem(0)) {deployModGUI();} else
if (actionEvent.getSource() == fileMenu.getItem(1)) {importModGUI();} else if (actionEvent.getSource() == fileMenu.getItem(1)) {importModGUI();} else
if (actionEvent.getSource() == fileMenu.getItem(2)) {removeAllGUI();} else if (actionEvent.getSource() == fileMenu.getItem(2)) {removeAllGUI();} else
if (actionEvent.getSource() == fileMenu.getItem(4)) {optionsGUI();} if (actionEvent.getSource() == fileMenu.getItem(4)) {optionsGUI();} else
if (actionEvent.getSource() == helpMenu.getItem(0)) {new Rowlf().displayAboutScreen();}
} }
// Will likely split the below functions into separate classes to work with intellij GUI designer. // Will likely split the below functions into separate classes to work with intellij GUI designer.

57
src/Rowlf.form Normal file
View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Rowlf">
<grid id="27dc6" binding="frameContainer" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="5" bottom="5" right="5"/>
<constraints>
<xy x="20" y="20" width="1464" height="573"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="a5cc7" class="javax.swing.JLabel" binding="picLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false">
<maximum-size width="-1" height="100"/>
</grid>
</constraints>
<properties>
<text value="Aww fiddlesticks, what now?"/>
</properties>
</component>
<component id="acd2f" class="javax.swing.JTextField" binding="informationText">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="4" hsize-policy="6" anchor="0" fill="2" indent="0" use-parent-layout="false">
<preferred-size width="350" height="-1"/>
<maximum-size width="380" height="200"/>
</grid>
</constraints>
<properties>
<horizontalAlignment value="0"/>
<text value="Do you think we should appeal to the alien authorities?"/>
</properties>
</component>
<component id="f7110" class="javax.swing.JLabel" binding="versionLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="20"/>
<maximum-size width="-1" height="20"/>
</grid>
</constraints>
<properties>
<text value="Version Unknown"/>
</properties>
</component>
<component id="4a55c" class="javax.swing.JLabel" binding="environmentLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="20"/>
<maximum-size width="-1" height="20"/>
</grid>
</constraints>
<properties>
<text value="Platform Unknown"/>
</properties>
</component>
</children>
</grid>
</form>

74
src/Rowlf.java Normal file
View File

@ -0,0 +1,74 @@
/*
* Firestar Mod Manager
* Copyright (C) 2024 bonkmaykr
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
import javax.imageio.*;
import javax.swing.*;
import java.awt.*;
import java.awt.image.*;
import java.io.File;
import java.io.IOException;
import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE;
public class Rowlf {
JFrame frame = new JFrame();
JPanel frameContainer;
BufferedImage logo;
JLabel picLabel;
private JTextField informationText;
private JLabel versionLabel;
private JLabel environmentLabel;
public void displayAboutScreen() {
try {
logo = ImageIO.read(new File(System.getProperty("user.dir") + "/resources/logo_about.png"));
} catch (IOException e) {
System.out.println("ERROR: Failed to open About screen because we couldn't find an image needed to display the page.");
throw new RuntimeException(e);
}
//frame.add(picLabel);
frame.add(frameContainer); // initialize window contents -- will be handled by IntelliJ IDEA
picLabel.setIcon(new ImageIcon(logo));picLabel.setText("");
informationText.getDocument().putProperty("filterNewlines", Boolean.FALSE);
informationText.setText("Created by bonkmaykr\n" +
"a.k.a. \"Downforce Agent\"\n" +
"\n" +
"Special thanks to:\n" +
"ThatOneBonk, for almost beating me to it\n" +
"Wirlaburla, for web hosting and code help\n" +
"and to all the PSVita hackers who made this possible");
informationText.setHighlighter(null);
informationText.getCaret().setVisible(false);
informationText.setFocusable(false);
versionLabel.setText("Version " + Main.vstr + " (" + Main.vcode + ")");
environmentLabel.setText("Running on Java " + System.getProperty("java.version") + " for " + System.getProperty("os.name"));
// display window
frame.setSize(400, 320);
frame.setTitle("About Firestar");
frame.setResizable(false);
frame.setAlwaysOnTop(true);
frame.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
frame.setLayout(new GridLayout());
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}