Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SafetyFlux committed Jul 23, 2021
1 parent 070a606 commit d2bdc7a
Show file tree
Hide file tree
Showing 22 changed files with 369 additions and 396 deletions.
Binary file modified bin/CaptchaGUI$1.class
Binary file not shown.
Binary file modified bin/CaptchaGUI$2.class
Binary file not shown.
Binary file modified bin/CaptchaGUI$3.class
Binary file not shown.
Binary file modified bin/CaptchaGUI$4.class
Binary file not shown.
Binary file modified bin/CaptchaGUI$AboutListener.class
Binary file not shown.
Binary file modified bin/CaptchaGUI$AlchemyListener.class
Binary file not shown.
Binary file modified bin/CaptchaGUI$GridListener.class
Binary file not shown.
Binary file modified bin/CaptchaGUI$NewListener.class
Binary file not shown.
Binary file modified bin/CaptchaGUI$OperationListener.class
Binary file not shown.
Binary file added bin/CaptchaGUI$SaveListener.class
Binary file not shown.
Binary file modified bin/CaptchaGUI$ShortcutListener.class
Binary file not shown.
Binary file modified bin/CaptchaGUI$SymbolListener.class
Binary file not shown.
Binary file modified bin/CaptchaGUI.class
Binary file not shown.
Binary file modified bin/CaptchaPanel$EntryListener.class
Binary file not shown.
Binary file modified bin/CaptchaPanel$HoleListener.class
Binary file not shown.
Binary file modified bin/CaptchaPanel$ShortcutListener.class
Binary file not shown.
Binary file modified bin/CaptchaPanel$WardrobeListener.class
Binary file not shown.
Binary file modified bin/CaptchaPanel.class
Binary file not shown.
4 changes: 4 additions & 0 deletions res/ThemesMisc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Prospit
Derse
Cherub (Caliborn)
Cherub (Calliope)
2 changes: 1 addition & 1 deletion res/options.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"symbol":true,"main_code":"00000000","operations":false,"jade":0,"theme":"Blue (John)","alchemy":false,"oper":"NONE","type":"humans","alchemy_code_1":"00000000","grids":false,"alchemy_code_2":"00000000"}
{"symbol":true,"main_code":"00000000","operations":false,"jade":7,"theme":"Blue (John)","alchemy":false,"oper":"NONE","type":"humans","alchemy_code_1":"00000000","grids":false,"alchemy_code_2":"00000000"}
119 changes: 38 additions & 81 deletions src/CaptchaGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,21 @@ public class CaptchaGUI extends JFrame {
// All the JMenu components
private JMenuBar bar = new JMenuBar();
private JMenuItem newMI = new JMenuItem("New");
private JMenu save = new JMenu("Save");
private JMenuItem saveMI0 = new JMenuItem("Main Code");
private JMenuItem saveMI1 = new JMenuItem("Alchemy Code (Top)");
private JMenuItem saveMI2 = new JMenuItem("Alchemy Code (Bottom)");
private JMenuItem loadMI = new JMenuItem("Load");
private JMenu themes = new JMenu("Themes");
private JMenuItem saveMI = new JMenuItem("Save Card as Image ");
private JMenuItem symbolMI = new JMenuItem("Toggle Symbols");
private JMenu humans = new JMenu("Humans");
private JMenu trolls = new JMenu("Trolls");
private JMenu aspects = new JMenu("Aspects");
private JMenu sways = new JMenu("Lunar Sways");
private JMenu misc = new JMenu("Miscellaneous ");
private JMenuItem themesHuman[] = new JMenuItem[8];
private JMenuItem themesTroll[] = new JMenuItem[12];
private JMenuItem themesAspect[] = new JMenuItem[12];
private JMenuItem themesSway[] = new JMenuItem[2];
private JMenuItem themesMisc[] = new JMenuItem[4];
private JMenuItem alchemyMI = new JMenuItem("Toggle Alchemy");
private JMenuItem gridMI = new JMenuItem("Toggle Grids");
private JMenuItem operationMI = new JMenuItem("Toggle Other Operations");
private JMenuItem operationMI = new JMenuItem("Toggle Other Operations ");
private JMenuItem aboutMI = new JMenuItem("About");
private JMenuItem shortcutMI = new JMenuItem("Shortcuts");
private JMenuItem secretMI = new JMenuItem("???");
// The font used for the toolbar
private Font f = new Font("Courier", Font.BOLD, 14);

Expand All @@ -63,34 +57,12 @@ public CaptchaGUI() throws FileNotFoundException{
JMenu fileMenu = new JMenu("File");
fileMenu.setFont(f);
newMI.setFont(f);
save.setFont(f);
loadMI.setFont(f);
saveMI0.setFont(f);
saveMI1.setFont(f);
saveMI2.setFont(f);
saveMI.setFont(f);
fileMenu.add(newMI);
fileMenu.add(save);
fileMenu.add(loadMI);
save.add(saveMI0);
save.add(saveMI1);
save.add(saveMI2);
JMenu optMenu = new JMenu("Options");
optMenu.setFont(f);
themes.setFont(f);
alchemyMI.setFont(f);
gridMI.setFont(f);
operationMI.setFont(f);
symbolMI.setFont(f);
humans.setFont(f);
trolls.setFont(f);
aspects.setFont(f);
sways.setFont(f);
optMenu.add(themes);
optMenu.add(alchemyMI);
optMenu.add(gridMI);
optMenu.add(operationMI);
themes.add(symbolMI);
themes.add(humans);
fileMenu.add(saveMI);
JMenu themeMenu = new JMenu("Themes");
themeMenu.setFont(f);
themeMenu.add(humans);
Scanner reader = new Scanner(new File("res/ThemesHuman.txt"));
for (int i = 0; i < themesHuman.length; i++){
String th = reader.nextLine();
Expand All @@ -99,7 +71,7 @@ public CaptchaGUI() throws FileNotFoundException{
humans.add(themesHuman[i]);
}
reader.close();
themes.add(trolls);
themeMenu.add(trolls);
reader = new Scanner(new File("res/ThemesTroll.txt"));
for (int i = 0; i < themesTroll.length; i++){
String th = reader.nextLine();
Expand All @@ -108,7 +80,7 @@ public CaptchaGUI() throws FileNotFoundException{
trolls.add(themesTroll[i]);
}
reader.close();
themes.add(aspects);
themeMenu.add(aspects);
reader = new Scanner(new File("res/ThemesAspect.txt"));
for (int i = 0; i < themesAspect.length; i++){
String th = reader.nextLine();
Expand All @@ -117,34 +89,44 @@ public CaptchaGUI() throws FileNotFoundException{
aspects.add(themesAspect[i]);
}
reader.close();
themes.add(sways);
reader = new Scanner(new File("res/ThemesSway.txt"));
for (int i = 0; i < themesSway.length; i++){
themeMenu.add(misc);
reader = new Scanner(new File("res/ThemesMisc.txt"));
for (int i = 0; i < themesMisc.length; i++){
String th = reader.nextLine();
themesSway[i] = new JMenuItem(th);
themesSway[i].setFont(f);
sways.add(themesSway[i]);
themesMisc[i] = new JMenuItem(th);
themesMisc[i].setFont(f);
misc.add(themesMisc[i]);
}
reader.close();
JMenu optMenu = new JMenu("Options");
optMenu.setFont(f);
alchemyMI.setFont(f);
gridMI.setFont(f);
operationMI.setFont(f);
symbolMI.setFont(f);
humans.setFont(f);
trolls.setFont(f);
aspects.setFont(f);
misc.setFont(f);
optMenu.add(alchemyMI);
optMenu.add(gridMI);
optMenu.add(operationMI);
optMenu.add(symbolMI);
JMenu helpMenu = new JMenu("Help");
helpMenu.setFont(f);
aboutMI.setFont(f);
shortcutMI.setFont(f);
secretMI.setFont(f);
helpMenu.add(aboutMI);
helpMenu.add(shortcutMI);
helpMenu.add(secretMI);
bar.add(fileMenu);
bar.add(themeMenu);
bar.add(optMenu);
bar.add(helpMenu);
setJMenuBar(bar);

// Add action listeners for each toolbar item
newMI.addActionListener(new NewListener());
saveMI0.addActionListener(new SaveListener0());
saveMI1.addActionListener(new SaveListener1());
saveMI2.addActionListener(new SaveListener2());
loadMI.addActionListener(new LoadListener());
saveMI.addActionListener(new SaveListener());
symbolMI.addActionListener(new SymbolListener());
for (int i = 0; i < themesHuman.length; i++){
final int j = i;
Expand All @@ -170,11 +152,11 @@ public void actionPerformed(ActionEvent e){
}
});
}
for (int i = 0; i < themesSway.length; i++){
for (int i = 0; i < themesMisc.length; i++){
final int j = i;
themesSway[j].addActionListener(new ActionListener(){
themesMisc[j].addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
panel.changeTheme(themesSway[j].getText(), "sways");
panel.changeTheme(themesMisc[j].getText(), "miscellaneous");
}
});
}
Expand All @@ -183,7 +165,6 @@ public void actionPerformed(ActionEvent e){
operationMI.addActionListener(new OperationListener());
aboutMI.addActionListener(new AboutListener());
shortcutMI.addActionListener(new ShortcutListener());
secretMI.addActionListener(new SecretListener());

}

Expand All @@ -194,27 +175,9 @@ public void actionPerformed(ActionEvent e){
}
}

private class SaveListener0 implements ActionListener{
public void actionPerformed(ActionEvent e){
panel.save(0);
}
}

private class SaveListener1 implements ActionListener{
public void actionPerformed(ActionEvent e){
panel.save(1);
}
}

private class SaveListener2 implements ActionListener{
public void actionPerformed(ActionEvent e){
panel.save(2);
}
}

private class LoadListener implements ActionListener{
private class SaveListener implements ActionListener{
public void actionPerformed(ActionEvent e){
panel.load();
panel.savePrompt();
}
}

Expand Down Expand Up @@ -254,12 +217,6 @@ public void actionPerformed(ActionEvent e) {
}
}

private class SecretListener implements ActionListener{
public void actionPerformed(ActionEvent e){
panel.secretCode();
}
}

// Main component where the GUI is created
public static void main(String[] args) throws FileNotFoundException {

Expand Down
Loading

0 comments on commit d2bdc7a

Please sign in to comment.