diff --git a/src/main/java/com/cemu_UI/application/Main.java b/src/main/java/com/cemu_UI/application/Main.java index dcbb68d..d14f12f 100644 --- a/src/main/java/com/cemu_UI/application/Main.java +++ b/src/main/java/com/cemu_UI/application/Main.java @@ -141,7 +141,6 @@ public class Main extends Application { mainWindowController.setLanguage("en_US"); mainWindowController.setLastLocalSync(0); mainWindowController.setxPosHelper(0); - mainWindowController.setExecuteCommand(mainWindowController.getCemuPath() + "/Cemu.exe -g "); mainWindowController.saveSettings(); Runtime.getRuntime().exec("java -jar cemu_UI.jar"); //start again (preventing Bugs) System.exit(0); //finishes itself diff --git a/src/main/java/com/cemu_UI/application/MainWindowController.java b/src/main/java/com/cemu_UI/application/MainWindowController.java index ac4658f..db639c5 100644 --- a/src/main/java/com/cemu_UI/application/MainWindowController.java +++ b/src/main/java/com/cemu_UI/application/MainWindowController.java @@ -284,14 +284,13 @@ public class MainWindowController { private String cemuPath; private String romDirectoryPath; private String gameExecutePath; - private String executeCommand; private String color; private String dialogBtnStyle; private String selectedGameTitleID; private String selectedGameTitle; private String id; private String version = "0.3.0"; - private String buildNumber = "073"; + private String buildNumber = "075"; private String versionName = "Puzzle Plank Galaxy"; private int xPos = -200; private int yPos = 17; @@ -404,7 +403,6 @@ public class MainWindowController { cemuTextField.setText(cemuPath); romTextField.setText(romDirectoryPath); - executeCommandTextFiled.setText(getExecuteCommand()); colorPicker.setValue(Color.valueOf(getColor())); fullscreenToggleBtn.setSelected(isFullscreen()); cloudSyncToggleBtn.setSelected(isCloudSync()); @@ -821,14 +819,6 @@ public class MainWindowController { saveSettings(); } }); - - executeCommandTextFiled.textProperty().addListener(new ChangeListener() { - @Override - public void changed(ObservableValue observable, String oldValue, String newValue) { - setExecuteCommand(executeCommandTextFiled.getText()); - saveSettings(); - } - }); LOGGER.info("initializing Actions done!"); } @@ -1055,12 +1045,8 @@ public class MainWindowController { void fullscreenToggleBtnAction(ActionEvent event) { if (fullscreen) { fullscreen = false; - setExecuteCommand(getExecuteCommand().replace("-f -g", "-g")); - executeCommandTextFiled.setText(getExecuteCommand()); } else { fullscreen = true; - setExecuteCommand(getExecuteCommand().replace("-g", "-f -g")); - executeCommandTextFiled.setText(getExecuteCommand()); } saveSettings(); } @@ -1669,7 +1655,6 @@ public class MainWindowController { try { props.setProperty("cemuPath", getCemuPath()); props.setProperty("romPath", getRomDirectoryPath()); - props.setProperty("executeCommand", getExecuteCommand()); props.setProperty("color", getColor()); props.setProperty("language", getLanguage()); props.setProperty("fullscreen", String.valueOf(isFullscreen())); @@ -1727,13 +1712,6 @@ public class MainWindowController { setRomDirectoryPath(""); } - if (props.getProperty("executeCommand") == null) { - LOGGER.error("could not load executeCommand, setting default instead!"); - setExecuteCommand(getCemuPath() + "\\Cemu.exe -g "); - } else { - setExecuteCommand(props.getProperty("executeCommand")); - } - try { setColor(props.getProperty("color")); } catch (Exception e) { @@ -1907,14 +1885,6 @@ public class MainWindowController { public void setRomDirectoryPath(String romDirectoryPath) { this.romDirectoryPath = romDirectoryPath; } - - public String getExecuteCommand() { - return executeCommand; - } - - public void setExecuteCommand(String executeCommand) { - this.executeCommand = executeCommand; - } public String getColor() { return color; diff --git a/src/main/java/com/cemu_UI/application/playGame.java b/src/main/java/com/cemu_UI/application/playGame.java index 751c896..4b7074f 100644 --- a/src/main/java/com/cemu_UI/application/playGame.java +++ b/src/main/java/com/cemu_UI/application/playGame.java @@ -45,7 +45,7 @@ public class playGame extends Thread{ @Override public void run(){ String selectedGameTitleID = mainWindowController.getSelectedGameTitleID(); - String executeComand; +// String executeComand; long startTime; long endTime; int timePlayedNow; @@ -57,25 +57,31 @@ public class playGame extends Thread{ }); startTime = System.currentTimeMillis(); try{ - executeComand = mainWindowController.getExecuteCommand() + " \"" + mainWindowController.getGameExecutePath() + "\""; +// executeComand = mainWindowController.getExecuteCommand() + " \"" + mainWindowController.getGameExecutePath() + "\""; + + if(mainWindowController.isFullscreen()){ + if(System.getProperty("os.name").equals("Linux")){ + p = new ProcessBuilder("wine", mainWindowController.getCemuPath() + "/Cemu.exe", "-f", + "-g \"" + mainWindowController.getGameExecutePath() + "\"").start(); + } else { + p = new ProcessBuilder(mainWindowController.getCemuPath() + "/Cemu.exe", "-f", + "-g \"" + mainWindowController.getGameExecutePath() + "\"").start(); + } + }else{ + if(System.getProperty("os.name").equals("Linux")){ + p = new ProcessBuilder("wine", mainWindowController.getCemuPath() + "/Cemu.exe", + "-g \"" + mainWindowController.getGameExecutePath() + "\"").start(); + } else { + p = new ProcessBuilder(mainWindowController.getCemuPath() + "/Cemu.exe", + "-g \"" + mainWindowController.getGameExecutePath() + "\"").start(); + } + } +// LOGGER.info(p.toString()); -// if(mainWindowController.isFullscreen()){ -// if(System.getProperty("os.name").equals("Linux")){ -// executeComand = "wine "+mainWindowController.getCemuPath()+"/Cemu.exe -f -g \""+mainWindowController.getGameExecutePath()+"\""; -// } else { -// executeComand = mainWindowController.getCemuPath()+"\\Cemu.exe -f -g \""+mainWindowController.getGameExecutePath()+"\""; -// } -// }else{ -// if(System.getProperty("os.name").equals("Linux")){ -// executeComand = "wine "+mainWindowController.getCemuPath()+"/Cemu.exe -g \""+mainWindowController.getGameExecutePath()+"\""; -// } else { -// executeComand = mainWindowController.getCemuPath() + "\\Cemu.exe -g " + "\"" + mainWindowController.getGameExecutePath() + "\""; -// } -// } +// p = Runtime.getRuntime().exec("); +// p = new ProcessBuilder("wine", "/home/jannik/Downloads/cemu_1.11.3/Cemu.exe", "-g \"" + mainWindowController.getGameExecutePath() + "\"").start(); - LOGGER.info(executeComand); - p = Runtime.getRuntime().exec(executeComand); p.waitFor(); endTime = System.currentTimeMillis(); timePlayedNow = (int) Math.floor(((endTime - startTime)/1000/60)); diff --git a/src/main/resources/fxml/MainWindow.fxml b/src/main/resources/fxml/MainWindow.fxml index b0c0bdb..2f510b1 100644 --- a/src/main/resources/fxml/MainWindow.fxml +++ b/src/main/resources/fxml/MainWindow.fxml @@ -170,15 +170,6 @@ - - - - - - -