Skip to content

Commit

Permalink
0.1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondPRO02 committed Aug 17, 2023
1 parent c7b14d3 commit a79c392
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 54 deletions.
Binary file modified builds/HentaiGameManager.exe
Binary file not shown.
Binary file modified builds/HentaiGameManager.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Also, discord integration, because why not
- [ ] FAQ
- [ ] Optimizations
- [ ] Text size small on large display - [Bug here](<https://bugs.openjdk.org/browse/JDK-8202973>)
- [ ] Random game choose if you are bored (Maybe with filter)
- [x] Random game choose if you are bored (Maybe with filter)

---

Expand Down
2 changes: 1 addition & 1 deletion src/addUpdRemGames/addGames/addManually.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class addManually {
public static void addOneGameToFile(){
boolean repeat = true;
while (repeat) {
JPanel panel = new JPanel(new GridLayout(14*2, 0));
JPanel panel = new JPanel(new GridLayout(8*2, 2));

JTextField id = new JTextField(6);
JTextField name = new JTextField(40);
Expand Down
2 changes: 1 addition & 1 deletion src/addUpdRemGames/updateGames/updateManually.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class updateManually {
static String[] base = langLoad.base, basic = langLoad.basic, jla = langLoad.jlapa, folder = langLoad.folder, jrb = langLoad.jrabu;
public static void updateOneGameFromToFile(){
JOptionPane optionPane = new JOptionPane();
JPanel panel = new JPanel(new GridLayout(14*2, 0));
JPanel panel = new JPanel(new GridLayout(8*2, 2));
JTextField id = new JTextField();
Object[] message = {
jla[0]!=null?jla[0]:"ID of the game to update:", id
Expand Down
15 changes: 10 additions & 5 deletions src/main/application/frameCreate.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class frameCreate extends JFrame implements ActionListener {
JMenuItem saveFileToDifferent, refreshTable, refreshFromAPI;

JMenu random;
JMenuItem fullRandom, randomDev, randomEngine, randomSite;
JMenuItem fullRandom, randomDev, randomProgress, randomEngine, randomSite;

JMenu search;
JMenuItem searchById, searchByName, searchByDeveloper;
Expand Down Expand Up @@ -89,9 +89,10 @@ public void WindowCreate(Object[][] dataFromXMLFile) {
// TODO add language for random
mb.add(random = new JMenu("Random"));
random.add(fullRandom = new JMenuItem("Fully random game")); fullRandom.setActionCommand("RandomFully");
random.add(randomDev = new JMenuItem("Random game from a developer")); randomDev.setActionCommand("RandomDev");
random.add(randomEngine = new JMenuItem("Random with specific engine")); randomEngine.setActionCommand("RandomEngine");
random.add(randomSite = new JMenuItem("Random from specific site")); randomSite.setActionCommand("RandomSite");
random.add(randomDev = new JMenuItem("Random game by developer")); randomDev.setActionCommand("RandomDev");
random.add(randomProgress = new JMenuItem("Random by player progress")); randomProgress.setActionCommand("RandomProgress");
random.add(randomEngine = new JMenuItem("Random by engine")); randomEngine.setActionCommand("RandomEngine");
random.add(randomSite = new JMenuItem("Random by site")); randomSite.setActionCommand("RandomSite");

mb.add(search = new JMenu(bu[1]!=null?bu[1]:"Search"));
search.add(searchById = new JMenuItem(bu[15]!=null?bu[15]:"Search by ID")); searchById.setActionCommand("Search by ID");
Expand Down Expand Up @@ -137,7 +138,8 @@ public void WindowCreate(Object[][] dataFromXMLFile) {
refreshFromAPI.addActionListener(this);

fullRandom.addActionListener(this); randomDev.addActionListener(this);
randomEngine.addActionListener(this); randomSite.addActionListener(this);
randomProgress.addActionListener(this); randomEngine.addActionListener(this);
randomSite.addActionListener(this);

searchById.addActionListener(this);searchByName.addActionListener(this);
searchByDeveloper.addActionListener(this);
Expand Down Expand Up @@ -236,6 +238,7 @@ public void actionPerformed(ActionEvent e) {

case "RandomFully": randomGame.fullyRandom(); break;
case "RandomDev": randomGame.randomFromDeveloper(); break;
case "RandomProgress": randomGame.randomFromProgress(); break;
case "RandomEngine": randomGame.randomWithEngine(); break;
case "RandomSite": randomGame.randomFromSite(); break;

Expand Down Expand Up @@ -311,6 +314,7 @@ private void WindowRefresh(){
random.setBackground(bg); random.setForeground(fg);
fullRandom.setBackground(bg); fullRandom.setForeground(fg);
randomDev.setBackground(bg); randomDev.setForeground(fg);
randomProgress.setBackground(bg); randomProgress.setForeground(fg);
randomEngine.setBackground(bg); randomEngine.setForeground(fg);
randomSite.setBackground(bg); randomSite.setForeground(fg);

Expand Down Expand Up @@ -386,6 +390,7 @@ private void WindowRefresh(){
random.setBackground(null); random.setForeground(null);
fullRandom.setBackground(null); fullRandom.setForeground(null);
randomDev.setBackground(null); randomDev.setForeground(null);
randomProgress.setBackground(null); randomProgress.setForeground(null);
randomEngine.setBackground(null); randomEngine.setForeground(null);
randomSite.setBackground(null); randomSite.setForeground(null);

Expand Down
81 changes: 35 additions & 46 deletions src/main/application/randomGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,75 +26,64 @@ public static void fullyRandom() {
}

public static void randomFromDeveloper() {
Integer devLegth = 0; String wantedRandomDev;
wantedRandomDev = JOptionPane.showInputDialog(null, "Enter developer name you wish to search for:", "Random game from developer", JOptionPane.QUESTION_MESSAGE);
for (int i = 0; i < allGames.length; i++) {
if (allGames[i][3].equals(wantedRandomDev)) {
devLegth++;
}
}
if (devLegth == 0) { JOptionPane.showMessageDialog(null, "No games found from developer: "+wantedRandomDev, "Random game from developer", JOptionPane.INFORMATION_MESSAGE); return;}
Object[][] gamesFromDevs = new Object[devLegth][allGames[0].length];
for (int i = 0; i < allGames.length; i++) {
if (allGames[i][3].equals(wantedRandomDev)) {
gamesFromDevs[i] = allGames[i];
}
}
Integer random = (int) (Math.random() * devLegth);
Object[] result = gamesFromDevs[random];
resultShow(result, "Random game from developer");
String wantedRandomDev = JOptionPane.showInputDialog(null, "Enter developer name you wish to search for:", "Random game from developer", JOptionPane.QUESTION_MESSAGE);
if (wantedRandomDev == null) { return; }
Object[] result = randomFilter(3, "from developer", wantedRandomDev);
if (result != null) {resultShow(result, "Random game from developer");}
}

public static void randomFromProgress(){
JRadioButton howFarUserPlayed_NotPlayed = new JRadioButton("Not played", true), howFarUserPlayed_Playing = new JRadioButton("In progress", false), howFarUserPlayed_Finished = new JRadioButton("Finish", false), howFarUserPlayed_100Percent = new JRadioButton("100% Finished", false);
howFarUserPlayed_NotPlayed.setActionCommand("Not played"); howFarUserPlayed_Playing.setActionCommand("In progress"); howFarUserPlayed_Finished.setActionCommand("Finish"); howFarUserPlayed_100Percent.setActionCommand("100% Finished");
ButtonGroup progressGroup = new ButtonGroup(); progressGroup.add(howFarUserPlayed_NotPlayed); progressGroup.add(howFarUserPlayed_Playing); progressGroup.add(howFarUserPlayed_Finished); progressGroup.add(howFarUserPlayed_100Percent);
JPanel progressPanel = new JPanel(); progressPanel.add(howFarUserPlayed_NotPlayed); progressPanel.add(howFarUserPlayed_Playing); progressPanel.add(howFarUserPlayed_Finished); progressPanel.add(howFarUserPlayed_100Percent);
JOptionPane.showMessageDialog(null, progressPanel, "Random game from progress", JOptionPane.QUESTION_MESSAGE);
Object[] result = randomFilter(10, "from progress", progressGroup.getSelection().getActionCommand());
if (result != null) {resultShow(result, "Random game from progress");}
}

public static void randomWithEngine() {
Integer engineLegth = 0; String wantedRandomEngine;
JRadioButton engine_Flash = new JRadioButton("Flash"), engine_HTML = new JRadioButton("HTML"), engine_Java = new JRadioButton("Java"), engine_QSP = new JRadioButton("QSP"), engine_RenPy = new JRadioButton("RenPy"), engine_RPGmaker = new JRadioButton("RPGmaker"), engine_Unity = new JRadioButton("Unity"), engine_Unreal = new JRadioButton("Unreal"), engine_WinGit = new JRadioButton("WinGit"), engine_WolfRPG = new JRadioButton("WolfRPG"), engine_other = new JRadioButton("other/unknown", true);
engine_Flash.setActionCommand("Flash"); engine_HTML.setActionCommand("HTML"); engine_Java.setActionCommand("Java"); engine_QSP.setActionCommand("QSP"); engine_RenPy.setActionCommand("RenPy"); engine_RPGmaker.setActionCommand("RPGmaker"); engine_Unity.setActionCommand("Unity"); engine_Unreal.setActionCommand("Unreal"); engine_WinGit.setActionCommand("WinGit"); engine_WolfRPG.setActionCommand("WolfRPG"); engine_other.setActionCommand("other/unknown");
engine_Flash.setActionCommand("Flash"); engine_HTML.setActionCommand("HTML"); engine_Java.setActionCommand("Java"); engine_QSP.setActionCommand("QSP"); engine_RenPy.setActionCommand("Ren'Py"); engine_RPGmaker.setActionCommand("RPGM"); engine_Unity.setActionCommand("Unity"); engine_Unreal.setActionCommand("Unreal Engine"); engine_WinGit.setActionCommand("WinGit"); engine_WolfRPG.setActionCommand("WolfRPG"); engine_other.setActionCommand("other/unknown");
ButtonGroup engineGroup = new ButtonGroup(); engineGroup.add(engine_Flash); engineGroup.add(engine_HTML); engineGroup.add(engine_Java); engineGroup.add(engine_QSP); engineGroup.add(engine_RenPy); engineGroup.add(engine_RPGmaker); engineGroup.add(engine_Unity); engineGroup.add(engine_Unreal); engineGroup.add(engine_WinGit); engineGroup.add(engine_WolfRPG); engineGroup.add(engine_other);
JLabel engineLabel = new JLabel("Select engine to search for:");
JPanel enginePanel = new JPanel(); enginePanel.add(engineLabel); enginePanel.add(engine_Flash); enginePanel.add(engine_HTML); enginePanel.add(engine_Java); enginePanel.add(engine_QSP); enginePanel.add(engine_RenPy); enginePanel.add(engine_RPGmaker); enginePanel.add(engine_Unity); enginePanel.add(engine_Unreal); enginePanel.add(engine_WinGit); enginePanel.add(engine_WolfRPG); enginePanel.add(engine_other);
JOptionPane.showMessageDialog(null, enginePanel, "Random game with engine", JOptionPane.QUESTION_MESSAGE);
wantedRandomEngine = engineGroup.getSelection().getActionCommand();
for (int i = 0; i < allGames.length; i++) {
if (allGames[i][12].equals(wantedRandomEngine)) {
engineLegth++;
}
}
if (engineLegth == 0) { JOptionPane.showMessageDialog(null, "No games found with engine: "+wantedRandomEngine, "Random game with engine", JOptionPane.INFORMATION_MESSAGE); return;}
Object[][] gamesWithEngine = new Object[engineLegth][allGames[0].length];
for (int i = 0; i < allGames.length; i++) {
if (allGames[i][12].equals(wantedRandomEngine)) {
gamesWithEngine[i] = allGames[i];
}
}
Integer random = (int) (Math.random() * engineLegth);
Object[] result = gamesWithEngine[random];
resultShow(result, "Random game with engine");
Object[] result = randomFilter(12, "with engine", engineGroup.getSelection().getActionCommand());
if (result != null) {resultShow(result, "Random game with engine");}
}

public static void randomFromSite() {
Integer siteLegth = 0; String wantedRandomSite;
JRadioButton site_F95 = new JRadioButton("F95zone"), site_man = new JRadioButton("Manual", true);
site_F95.setActionCommand("f95"); site_man.setActionCommand("man");
ButtonGroup sitesGroup = new ButtonGroup(); sitesGroup.add(site_F95); sitesGroup.add(site_man);
JLabel siteLabel = new JLabel("Select site to search from:");
JPanel sitePanel = new JPanel(); sitePanel.add(siteLabel) ;sitePanel.add(site_F95); sitePanel.add(site_man);
JOptionPane.showMessageDialog(null, sitePanel, "Random game from site", JOptionPane.QUESTION_MESSAGE);
wantedRandomSite = sitesGroup.getSelection().getActionCommand();
Object[] result = randomFilter(0, "from site", sitesGroup.getSelection().getActionCommand());
if (result != null) {resultShow(result, "Random game from site");}
}

private static Object[] randomFilter(Integer place, String fromWith, String wanted){
Integer length = 0;
Object[] result;
for (int i = 0; i < allGames.length; i++) {
if (allGames[i][0].equals(wantedRandomSite)) {
siteLegth++;
if (allGames[i][place].toString().contains(wanted)) {
length++;
}
}
if (siteLegth == 0) { JOptionPane.showMessageDialog(null, "No games found from site: "+wantedRandomSite, "Random game from site", JOptionPane.INFORMATION_MESSAGE); return;}
Object[][] gamesFromSite = new Object[siteLegth][allGames[0].length];
if (length == 0) { JOptionPane.showMessageDialog(null, "No games found "+fromWith+": "+wanted, "Random game "+fromWith, JOptionPane.INFORMATION_MESSAGE); return null;}
Object[][] gamesFromSite = new Object[length][allGames[0].length];
Integer counter = 0;
for (int i = 0; i < allGames.length; i++) {
if (allGames[i][0].equals(wantedRandomSite)) {
gamesFromSite[i] = allGames[i];
if (allGames[i][place].toString().contains(wanted)) {
gamesFromSite[counter] = allGames[i];
counter++;
}
}
Integer random = (int) (Math.random() * siteLegth);
Object[] result = gamesFromSite[random];
resultShow(result, "Random game from site");
Integer random = (int) (Math.random() * length);
result = gamesFromSite[random];
return result;
}

private static void resultShow(Object[] result, String title) {
Expand Down

0 comments on commit a79c392

Please sign in to comment.