Begin work on kermit rewrite
This commit is contained in:
parent
e0f764b71a
commit
6a1042b0c7
|
@ -119,6 +119,8 @@ public class Main {
|
|||
fExo2 = new Font("Arial", Font.PLAIN, 12);
|
||||
}
|
||||
|
||||
new WilkinsCoffee().setup(); // move to below if statement after completion
|
||||
|
||||
// check and load configs
|
||||
File fConf = new File(System.getProperty("user.home") + "/.firestar/firestar.conf");
|
||||
if (!fConf.isFile()) {
|
||||
|
|
58
firestar/src/main/java/WilkinsCoffee.form
Normal file
58
firestar/src/main/java/WilkinsCoffee.form
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="WilkinsCoffee">
|
||||
<grid id="27dc6" binding="frameContainer" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="10" left="10" bottom="10" right="10"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="416" height="455"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="a7e40" 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="9" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="76" height="76"/>
|
||||
<maximum-size width="76" height="76"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Image"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="29913" class="javax.swing.JEditorPane" binding="instructions">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="1" use-parent-layout="false">
|
||||
<preferred-size width="150" height="50"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
<contentType value="text/html"/>
|
||||
<disabledTextColor color="-592129"/>
|
||||
<editable value="false"/>
|
||||
<enabled value="false"/>
|
||||
<focusCycleRoot value="false"/>
|
||||
<focusable value="false"/>
|
||||
<font name="Exo 2" size="14"/>
|
||||
<foreground color="-592129"/>
|
||||
<margin top="0" left="5" bottom="0" right="0"/>
|
||||
<text value="<html> <head> </head> <body> <p id="first-p"> Welcome to the Firestar Setup. </p> <p> Please read the manual before continuing, and make sure your Vita is configured correctly first. You will need enso custom firmware and Repatch Reloaded for Firestar to work.<br><br>Emulator players can skip these preparations. </p> <p> Press &quot;Continue&quot; when you are ready. </p> </body> </html> "/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="c3ec3" class="javax.swing.JButton" binding="contBtn">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-2271221"/>
|
||||
<borderPainted value="false"/>
|
||||
<focusPainted value="false"/>
|
||||
<foreground color="-5180417"/>
|
||||
<text value="Continue"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
68
firestar/src/main/java/WilkinsCoffee.java
Normal file
68
firestar/src/main/java/WilkinsCoffee.java
Normal file
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* 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.ImageIO;
|
||||
import javax.swing.*;
|
||||
import javax.swing.text.html.HTMLDocument;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
|
||||
import static javax.swing.WindowConstants.EXIT_ON_CLOSE;
|
||||
|
||||
public class WilkinsCoffee {
|
||||
BufferedImage windowIcon;
|
||||
public JFrame frame = new JFrame();
|
||||
private JPanel frameContainer;
|
||||
private JLabel picLabel;
|
||||
private JEditorPane instructions;
|
||||
private JButton contBtn;
|
||||
|
||||
Image logo;
|
||||
|
||||
public void setup() {
|
||||
try {
|
||||
windowIcon = ImageIO.read(Main.class.getResourceAsStream("/titleIcon.png"));
|
||||
frame.setIconImage(windowIcon);
|
||||
} catch (IOException e) {
|
||||
System.out.println("ERROR: Failed to find /resources/titleIcon.png. Window will not have an icon.");
|
||||
}
|
||||
try {
|
||||
logo = ImageIO.read(Main.class.getResourceAsStream("/programIcon.png")).getScaledInstance(76, 76, Image.SCALE_SMOOTH);
|
||||
picLabel.setIcon(new ImageIcon(logo));picLabel.setText("");
|
||||
} catch (IOException e) {
|
||||
System.out.println("ERROR: Missing resource in Wilkins. Page will be without images.");
|
||||
picLabel.setText("");
|
||||
}
|
||||
|
||||
String bodyRule = "html, body {margin:0px;} p#first-p {margin-top:-13px;} p {margin-left:-20px;}";
|
||||
((HTMLDocument)instructions.getDocument()).getStyleSheet().addRule(bodyRule);
|
||||
instructions.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE); // makes text smaller than joe biden's windmill if font set manually. wtf??
|
||||
contBtn.setFont(Main.fExo2.deriveFont(Font.BOLD).deriveFont(12f));
|
||||
|
||||
frame.add(frameContainer); // initialize window contents -- will be handled by IntelliJ IDEA
|
||||
|
||||
frame.setSize(400, 400);
|
||||
frame.setTitle("Firestar Setup");
|
||||
frame.setResizable(false);
|
||||
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
|
||||
frame.setLayout(new GridLayout());
|
||||
frame.setLocationRelativeTo(null);
|
||||
frame.setVisible(true);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user