code clean up and minor fixes
*better save twice than non *fixed a bug that prevented cemu_UI from finding the savegames folder in google drive
This commit is contained in:
parent
65b716cb77
commit
9ab7b61cd9
|
@ -0,0 +1,3 @@
|
|||
/application/
|
||||
/recources/
|
||||
/cloudControllerInstances/
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -30,22 +30,27 @@
|
|||
</HBox>
|
||||
<VBox fx:id="sideMenuVBox" layoutY="32.0" prefHeight="568.0" prefWidth="175.0" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="38.0">
|
||||
<children>
|
||||
<JFXButton fx:id="aboutBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="150.0" onAction="#aboutBtnAction" prefHeight="38.0" prefWidth="150.0" text="About" textAlignment="LEFT">
|
||||
<JFXButton fx:id="aboutBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="190.0" onAction="#aboutBtnAction" prefHeight="38.0" prefWidth="190.0" text="About" textAlignment="LEFT">
|
||||
<font>
|
||||
<Font name="System Bold" size="14.0" />
|
||||
</font>
|
||||
</JFXButton>
|
||||
<JFXButton fx:id="settingsBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="150.0" onAction="#settingsBtnAction" prefHeight="38.0" prefWidth="150.0" text="Settings" textAlignment="LEFT">
|
||||
<JFXButton fx:id="settingsBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="213.0" onAction="#settingsBtnAction" prefHeight="38.0" prefWidth="213.0" text="Settings" textAlignment="LEFT">
|
||||
<font>
|
||||
<Font name="System Bold" size="14.0" />
|
||||
</font>
|
||||
</JFXButton>
|
||||
<JFXButton fx:id="addBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="150.0" onAction="#addBtnAction" prefHeight="38.0" prefWidth="150.0" text="Add new Game" textAlignment="LEFT">
|
||||
<JFXButton fx:id="addBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="193.0" onAction="#addBtnAction" prefHeight="38.0" prefWidth="193.0" text="Add new Game" textAlignment="LEFT">
|
||||
<font>
|
||||
<Font name="System Bold" size="14.0" />
|
||||
</font>
|
||||
</JFXButton>
|
||||
<JFXButton fx:id="reloadRomsBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="150.0" onAction="#reloadRomsBtnAction" prefHeight="38.0" prefWidth="150.0" text="reload roms" textAlignment="LEFT">
|
||||
<JFXButton fx:id="reloadRomsBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="199.0" onAction="#reloadRomsBtnAction" prefHeight="38.0" prefWidth="199.0" text="reload roms" textAlignment="LEFT">
|
||||
<font>
|
||||
<Font name="System Bold" size="14.0" />
|
||||
</font>
|
||||
</JFXButton>
|
||||
<JFXButton fx:id="smmdbBtn" alignment="TOP_LEFT" onAction="#smmdbBtnAction" prefHeight="38.0" prefWidth="216.0" text="smmdb">
|
||||
<font>
|
||||
<Font name="System Bold" size="14.0" />
|
||||
</font>
|
||||
|
@ -53,7 +58,7 @@
|
|||
</children>
|
||||
</VBox>
|
||||
<!-- space between settings sections 35px, between sections elements (label + element) 20px, between label and element 3px(or more) -->
|
||||
<AnchorPane fx:id="settingsAnchorPane" layoutX="38.0" layoutY="27.0" prefHeight="573.0" prefWidth="862.0" style="-fx-background-color: white;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="175.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
|
||||
<AnchorPane fx:id="settingsAnchorPane" layoutX="38.0" layoutY="27.0" prefHeight="573.0" style="-fx-background-color: white;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="175.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
|
||||
<children>
|
||||
<Label layoutX="22.0" layoutY="59.0" text="Cemu Directory" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="59.0" />
|
||||
<JFXTextField fx:id="cemuTextField" layoutX="18.0" layoutY="83.0" maxWidth="305.0" minWidth="305.0" onAction="#cemuTextFieldAction" prefHeight="32.0" prefWidth="305.0" promptText="cemu directory" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="79.0" />
|
||||
|
@ -77,6 +82,7 @@
|
|||
<JFXToggleButton fx:id="cloudSyncToggleBtn" layoutX="14.0" layoutY="264.0" onAction="#cloudSyncToggleBtnAction" text="cloud savegames (Google Drive)" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="267.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<AnchorPane fx:id="smmdbAnchorPane" style="-fx-background-color: white;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="175.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0" />
|
||||
<JFXButton fx:id="playBtn" buttonType="RAISED" maxHeight="38.0" maxWidth="100.0" onAction="#playBtnAction" ripplerFill="#c92a2a" text="play" visible="false" AnchorPane.bottomAnchor="7.0" AnchorPane.leftAnchor="396.0" AnchorPane.rightAnchor="396.0" AnchorPane.topAnchor="555.0">
|
||||
<font>
|
||||
<Font name="System Bold" size="14.0" />
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -30,21 +30,22 @@ public class CloudController {
|
|||
|
||||
void initializeConnection(String cloudService, String cemuDirectory) {
|
||||
System.out.println("sartting cloud initialisation... ");
|
||||
if(cloudService == "GoogleDrive") {
|
||||
if(cloudService.equals("GoogleDrive")) {
|
||||
System.out.println("selected service is Google Drive");
|
||||
try {
|
||||
googleDriveController.main(cemuDirectory);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if(cloudService == "Dropbox") {
|
||||
|
||||
if(cloudService.equals("Dropbox")) {
|
||||
System.out.println("selected service is Dropbox");
|
||||
}
|
||||
System.out.println("cloud initialisation done!");
|
||||
}
|
||||
|
||||
void stratupCheck(String cloudService, String cemuDirectory) {
|
||||
if(cloudService == "GoogleDrive") {
|
||||
if(cloudService.equals("GoogleDrive")) {
|
||||
System.out.println("starting startup check google drive...");
|
||||
try {
|
||||
if (!googleDriveController.checkFolder()) {
|
||||
|
@ -70,7 +71,7 @@ public class CloudController {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if(cloudService == "Dropbox") {
|
||||
if(cloudService.equals("Dropbox")) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -87,19 +88,20 @@ public class CloudController {
|
|||
});
|
||||
System.out.println("starting sync in new thread...");
|
||||
|
||||
if(cloudService == "GoogleDrive") {
|
||||
if(cloudService.equals("GoogleDrive")) {
|
||||
try {
|
||||
googleDriveController.sync(cemuDirectory);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if(cloudService == "Dropbox") {
|
||||
if(cloudService.equals("Dropbox")) {
|
||||
|
||||
}
|
||||
Platform.runLater(() -> {
|
||||
main.mainWindowController.getPlayBtn().setText("play");
|
||||
});
|
||||
main.mainWindowController.saveSettings();
|
||||
System.out.println("sync finished!");
|
||||
}
|
||||
});
|
||||
|
@ -114,14 +116,14 @@ public class CloudController {
|
|||
public void run() {
|
||||
System.out.println("starting uploadFile in new thread...");
|
||||
|
||||
if(cloudService == "GoogleDrive") {
|
||||
if(cloudService.equals("GoogleDrive")) {
|
||||
try {
|
||||
googleDriveController.uploadFile(file);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if(cloudService == "Dropbox") {
|
||||
if(cloudService.equals("Dropbox")) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -129,26 +131,22 @@ public class CloudController {
|
|||
|
||||
}
|
||||
|
||||
// void download(String cloudService) {
|
||||
//
|
||||
// }
|
||||
|
||||
public String getFolderID(String cloudService) {
|
||||
String folderID = "";
|
||||
if(cloudService == "GoogleDrive") {
|
||||
if(cloudService.equals("GoogleDrive")) {
|
||||
folderID = googleDriveController.getFolderID();
|
||||
}
|
||||
if(cloudService == "Dropbox") {
|
||||
if(cloudService.equals("Dropbox")) {
|
||||
|
||||
}
|
||||
return folderID;
|
||||
}
|
||||
|
||||
public void setFolderID(String folderID, String cloudService) {
|
||||
if(cloudService == "GoogleDrive") {
|
||||
if(cloudService.equals("GoogleDrive")) {
|
||||
googleDriveController.setFolderID(folderID);
|
||||
}
|
||||
if(cloudService == "Dropbox") {
|
||||
if(cloudService.equals("Dropbox")) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,22 +30,27 @@
|
|||
</HBox>
|
||||
<VBox fx:id="sideMenuVBox" layoutY="32.0" prefHeight="568.0" prefWidth="175.0" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="38.0">
|
||||
<children>
|
||||
<JFXButton fx:id="aboutBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="150.0" onAction="#aboutBtnAction" prefHeight="38.0" prefWidth="150.0" text="About" textAlignment="LEFT">
|
||||
<JFXButton fx:id="aboutBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="190.0" onAction="#aboutBtnAction" prefHeight="38.0" prefWidth="190.0" text="About" textAlignment="LEFT">
|
||||
<font>
|
||||
<Font name="System Bold" size="14.0" />
|
||||
</font>
|
||||
</JFXButton>
|
||||
<JFXButton fx:id="settingsBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="150.0" onAction="#settingsBtnAction" prefHeight="38.0" prefWidth="150.0" text="Settings" textAlignment="LEFT">
|
||||
<JFXButton fx:id="settingsBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="213.0" onAction="#settingsBtnAction" prefHeight="38.0" prefWidth="213.0" text="Settings" textAlignment="LEFT">
|
||||
<font>
|
||||
<Font name="System Bold" size="14.0" />
|
||||
</font>
|
||||
</JFXButton>
|
||||
<JFXButton fx:id="addBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="150.0" onAction="#addBtnAction" prefHeight="38.0" prefWidth="150.0" text="Add new Game" textAlignment="LEFT">
|
||||
<JFXButton fx:id="addBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="193.0" onAction="#addBtnAction" prefHeight="38.0" prefWidth="193.0" text="Add new Game" textAlignment="LEFT">
|
||||
<font>
|
||||
<Font name="System Bold" size="14.0" />
|
||||
</font>
|
||||
</JFXButton>
|
||||
<JFXButton fx:id="reloadRomsBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="150.0" onAction="#reloadRomsBtnAction" prefHeight="38.0" prefWidth="150.0" text="reload roms" textAlignment="LEFT">
|
||||
<JFXButton fx:id="reloadRomsBtn" alignment="TOP_LEFT" maxHeight="38.0" maxWidth="199.0" onAction="#reloadRomsBtnAction" prefHeight="38.0" prefWidth="199.0" text="reload roms" textAlignment="LEFT">
|
||||
<font>
|
||||
<Font name="System Bold" size="14.0" />
|
||||
</font>
|
||||
</JFXButton>
|
||||
<JFXButton fx:id="smmdbBtn" alignment="TOP_LEFT" onAction="#smmdbBtnAction" prefHeight="38.0" prefWidth="216.0" text="smmdb">
|
||||
<font>
|
||||
<Font name="System Bold" size="14.0" />
|
||||
</font>
|
||||
|
@ -53,7 +58,7 @@
|
|||
</children>
|
||||
</VBox>
|
||||
<!-- space between settings sections 35px, between sections elements (label + element) 20px, between label and element 3px(or more) -->
|
||||
<AnchorPane fx:id="settingsAnchorPane" layoutX="38.0" layoutY="27.0" prefHeight="573.0" prefWidth="862.0" style="-fx-background-color: white;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="175.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
|
||||
<AnchorPane fx:id="settingsAnchorPane" layoutX="38.0" layoutY="27.0" prefHeight="573.0" style="-fx-background-color: white;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="175.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
|
||||
<children>
|
||||
<Label layoutX="22.0" layoutY="59.0" text="Cemu Directory" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="59.0" />
|
||||
<JFXTextField fx:id="cemuTextField" layoutX="18.0" layoutY="83.0" maxWidth="305.0" minWidth="305.0" onAction="#cemuTextFieldAction" prefHeight="32.0" prefWidth="305.0" promptText="cemu directory" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="79.0" />
|
||||
|
@ -77,6 +82,7 @@
|
|||
<JFXToggleButton fx:id="cloudSyncToggleBtn" layoutX="14.0" layoutY="264.0" onAction="#cloudSyncToggleBtnAction" text="cloud savegames (Google Drive)" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="267.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<AnchorPane fx:id="smmdbAnchorPane" style="-fx-background-color: white;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="175.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0" />
|
||||
<JFXButton fx:id="playBtn" buttonType="RAISED" maxHeight="38.0" maxWidth="100.0" onAction="#playBtnAction" ripplerFill="#c92a2a" text="play" visible="false" AnchorPane.bottomAnchor="7.0" AnchorPane.leftAnchor="396.0" AnchorPane.rightAnchor="396.0" AnchorPane.topAnchor="555.0">
|
||||
<font>
|
||||
<Font name="System Bold" size="14.0" />
|
||||
|
|
|
@ -27,6 +27,7 @@ import java.time.LocalDate;
|
|||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
@ -37,6 +38,7 @@ import com.jfoenix.controls.JFXHamburger;
|
|||
import com.jfoenix.controls.JFXTextField;
|
||||
import com.jfoenix.controls.JFXToggleButton;
|
||||
import com.jfoenix.transitions.hamburger.HamburgerBackArrowBasicTransition;
|
||||
|
||||
import javafx.animation.FadeTransition;
|
||||
import javafx.animation.ParallelTransition;
|
||||
import javafx.animation.TranslateTransition;
|
||||
|
@ -82,6 +84,9 @@ public class MainWindowController {
|
|||
@FXML
|
||||
private JFXButton reloadRomsBtn;
|
||||
|
||||
@FXML
|
||||
private JFXButton smmdbBtn;
|
||||
|
||||
@FXML
|
||||
private JFXButton cemuTFBtn;
|
||||
|
||||
|
@ -118,6 +123,9 @@ public class MainWindowController {
|
|||
@FXML
|
||||
private AnchorPane settingsAnchorPane;
|
||||
|
||||
@FXML
|
||||
private AnchorPane smmdbAnchorPane;
|
||||
|
||||
@FXML
|
||||
private AnchorPane gamesAnchorPane;
|
||||
|
||||
|
@ -138,7 +146,7 @@ public class MainWindowController {
|
|||
private boolean playTrue = false;
|
||||
private boolean fullscreen;
|
||||
private boolean cloudSync;
|
||||
private String cloudService = "GoogleDrive"; //set cloud provider (at the moment only GoogleDrive, Dropbox is planed)
|
||||
private String cloudService; //set cloud provider (at the moment only GoogleDrive, Dropbox is planed)
|
||||
private String cemuPath;
|
||||
private String romPath;
|
||||
private String gameExecutePath;
|
||||
|
@ -146,7 +154,7 @@ public class MainWindowController {
|
|||
private String selectedGameTitle;
|
||||
private String color;
|
||||
private String version = "0.1.5";
|
||||
private String buildNumber = "015";
|
||||
private String buildNumber = "017";
|
||||
private String versionName = "Gusty Garden";
|
||||
private int xPos = -200;
|
||||
private int yPos = 17;
|
||||
|
@ -173,10 +181,12 @@ public class MainWindowController {
|
|||
private ImageView info_black = new ImageView(new Image("recources/icons/ic_info_black_24dp_1x.png"));
|
||||
private ImageView settings_black = new ImageView(new Image("recources/icons/ic_settings_black_24dp_1x.png"));
|
||||
private ImageView cached_black = new ImageView(new Image("recources/icons/ic_cached_black_24dp_1x.png"));
|
||||
private ImageView smmdb_black = new ImageView(new Image("recources/icons/ic_get_app_black_24dp_1x.png"));
|
||||
private ImageView add_circle_white = new ImageView(new Image("recources/icons/ic_add_circle_white_24dp_1x.png"));
|
||||
private ImageView info_white = new ImageView(new Image("recources/icons/ic_info_white_24dp_1x.png"));
|
||||
private ImageView settings_white = new ImageView(new Image("recources/icons/ic_settings_white_24dp_1x.png"));
|
||||
private ImageView cached_white = new ImageView(new Image("recources/icons/ic_cached_white_24dp_1x.png"));
|
||||
private ImageView smmdb_white = new ImageView(new Image("recources/icons/ic_get_app_white_24dp_1x.png"));
|
||||
|
||||
public void setMain(Main main) {
|
||||
this.main = main;
|
||||
|
@ -190,6 +200,7 @@ public class MainWindowController {
|
|||
fullscreenToggleBtn.setSelected(isFullscreen());
|
||||
cloudSyncToggleBtn.setSelected(isCloudSync());
|
||||
edit.setDisable(true);
|
||||
smmdbBtn.setDisable(true);
|
||||
applyColor();
|
||||
}
|
||||
|
||||
|
@ -457,6 +468,11 @@ public class MainWindowController {
|
|||
System.exit(0); //finishes itself
|
||||
}
|
||||
|
||||
@FXML
|
||||
void smmdbBtnAction() {
|
||||
System.out.println("yeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeehaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
|
||||
}
|
||||
|
||||
@FXML
|
||||
void playBtnAction(ActionEvent event) throws InterruptedException, IOException{
|
||||
dbController.setLastPlayed(selectedGameTitleID);
|
||||
|
@ -516,13 +532,13 @@ public class MainWindowController {
|
|||
@FXML
|
||||
void cemuTextFieldAction(ActionEvent event){
|
||||
setCemuPath(cemuTextField.getText());
|
||||
saveSettings();//TODO remove (only save on exit settings)
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
@FXML
|
||||
void romTextFieldAction(ActionEvent event){
|
||||
setRomPath(romTextField.getText());
|
||||
saveSettings();//TODO remove (only save on exit settings)
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
@FXML
|
||||
|
@ -532,7 +548,7 @@ public class MainWindowController {
|
|||
}else{
|
||||
fullscreen = true;
|
||||
}
|
||||
saveSettings();//TODO remove (only save on exit settings)
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
@FXML
|
||||
|
@ -548,6 +564,8 @@ public class MainWindowController {
|
|||
Optional<ButtonType> coverResult = cloudWarningAlert.showAndWait();
|
||||
if (coverResult.get() == ButtonType.OK){
|
||||
cloudSync = true;
|
||||
//TODO rework for other cloud services
|
||||
cloudService = "GoogleDrive";
|
||||
main.cloudController.initializeConnection(getCloudService(), getCemuPath());
|
||||
main.cloudController.sync(getCloudService(), getCemuPath());
|
||||
} else {
|
||||
|
@ -555,7 +573,7 @@ public class MainWindowController {
|
|||
}
|
||||
|
||||
}
|
||||
saveSettings();//TODO remove (only save on exit settings)
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
@FXML
|
||||
|
@ -666,11 +684,19 @@ public class MainWindowController {
|
|||
dbController.loadSingleRom(titleID);
|
||||
} catch (SQLException e) {
|
||||
// Auto-generated catch block
|
||||
System.out.println("Oops, something went wrong! Error during adding a game.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* add game to the program and initialize all needed actions (start, time stamps, titleID)
|
||||
* @param title : game title
|
||||
* @param coverPath : path to cover (cache)
|
||||
* @param romPath : path to rom file (.rpx)
|
||||
* @param titleID : rom ID
|
||||
*/
|
||||
void addGame(String title, String coverPath, String romPath, String titleID){
|
||||
ImageView imageView = new ImageView();
|
||||
Label gameTitleLabel = new Label(title);
|
||||
|
@ -698,6 +724,7 @@ public class MainWindowController {
|
|||
public void handle(MouseEvent event) {
|
||||
System.out.println("selected: "+title+"; ID: "+titleID);
|
||||
|
||||
//getting the selected game index by comparing event.getSource() with games.get(i).getButton()
|
||||
for(int i=0; i<games.size(); i++){
|
||||
if(games.get(i).getButton() == event.getSource()){
|
||||
selectedUIDataIndex = i;
|
||||
|
@ -712,6 +739,7 @@ public class MainWindowController {
|
|||
games.get(selectedUIDataIndex).getLabel().setStyle("-fx-underline: true;");
|
||||
lastGameLabel = games.get(selectedUIDataIndex).getLabel();
|
||||
|
||||
//setting last played
|
||||
if(dbController.getLastPlayed(titleID).equals("") || dbController.getLastPlayed(titleID).equals(null)){
|
||||
lastTimePlayedBtn.setText("Last played, never");
|
||||
timePlayedBtn.setText(dbController.getTimePlayed(titleID)+ " min");
|
||||
|
@ -738,15 +766,19 @@ public class MainWindowController {
|
|||
}
|
||||
}
|
||||
|
||||
if(playTrue == false){
|
||||
if (!playTrue) {
|
||||
playBtnSlideIn();
|
||||
}
|
||||
if (menuTrue) {
|
||||
sideMenuSlideOut();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
games.add(new uiDataType(VBox, gameTitleLabel, gameBtn, titleID, romPath));
|
||||
}
|
||||
|
||||
//add all games to the UI (only called on startup)
|
||||
void addUIData(){
|
||||
for(int i=0; i<games.size(); i++){
|
||||
gamesAnchorPane.getChildren().add(games.get(i).getVBox());
|
||||
|
@ -784,6 +816,7 @@ public class MainWindowController {
|
|||
settingsBtn.setStyle("-fx-text-fill: WHITE;");
|
||||
addBtn.setStyle("-fx-text-fill: WHITE;");
|
||||
reloadRomsBtn.setStyle("-fx-text-fill: WHITE;");
|
||||
smmdbBtn.setStyle("-fx-text-fill: WHITE;");
|
||||
playBtn.setStyle("-fx-text-fill: WHITE; -fx-font-family: Roboto Medium;");
|
||||
cemuTFBtn.setStyle(btnStyleWhite);
|
||||
romTFBtn.setStyle(btnStyleWhite);
|
||||
|
@ -793,6 +826,7 @@ public class MainWindowController {
|
|||
settingsBtn.setGraphic(settings_white);
|
||||
addBtn.setGraphic(add_circle_white);
|
||||
reloadRomsBtn.setGraphic(cached_white);
|
||||
smmdbBtn.setGraphic(smmdb_white);
|
||||
|
||||
menuHam.getStyleClass().add("jfx-hamburgerW");
|
||||
}else{
|
||||
|
@ -800,6 +834,7 @@ public class MainWindowController {
|
|||
settingsBtn.setStyle("-fx-text-fill: BLACK;");
|
||||
addBtn.setStyle("-fx-text-fill: BLACK;");
|
||||
reloadRomsBtn.setStyle("-fx-text-fill: BLACK;");
|
||||
smmdbBtn.setStyle("-fx-text-fill: BLACK;");
|
||||
playBtn.setStyle("-fx-text-fill: BLACK; -fx-font-family: Roboto Medium;");
|
||||
cemuTFBtn.setStyle(btnStyleBlack);
|
||||
romTFBtn.setStyle(btnStyleBlack);
|
||||
|
@ -809,6 +844,7 @@ public class MainWindowController {
|
|||
settingsBtn.setGraphic(settings_black);
|
||||
addBtn.setGraphic(add_circle_black);
|
||||
reloadRomsBtn.setGraphic(cached_black);
|
||||
smmdbBtn.setGraphic(smmdb_black);
|
||||
|
||||
menuHam.getStyleClass().add("jfx-hamburgerB");
|
||||
}
|
||||
|
@ -827,6 +863,7 @@ public class MainWindowController {
|
|||
props.setProperty("color", getColor());
|
||||
props.setProperty("fullscreen", String.valueOf(isFullscreen()));
|
||||
props.setProperty("cloudSync", String.valueOf(cloudSync));
|
||||
props.setProperty("cloudService", getCloudService());
|
||||
props.setProperty("folderID", main.cloudController.getFolderID(getCloudService()));
|
||||
if(System.getProperty("os.name").equals("Linux")){
|
||||
outputStream = new FileOutputStream(fileLinux);
|
||||
|
@ -856,6 +893,7 @@ public class MainWindowController {
|
|||
setColor(props.getProperty("color"));
|
||||
setFullscreen(Boolean.parseBoolean(props.getProperty("fullscreen")));
|
||||
setCloudSync(Boolean.parseBoolean(props.getProperty("cloudSync")));
|
||||
setCloudService(props.getProperty("cloudService"));
|
||||
main.cloudController.setFolderID(props.getProperty("folderID"), getCloudService());
|
||||
inputStream.close();
|
||||
System.out.println("done!");
|
||||
|
|
|
@ -53,7 +53,7 @@ public class dbController {
|
|||
loadRomDatabase();
|
||||
loadGamesDatabase();
|
||||
createRomDatabase();
|
||||
loadRoms();
|
||||
loadAllRoms();
|
||||
checkRemoveEntry();
|
||||
System.out.println("<==========finished loading sql==========>");
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ public class dbController {
|
|||
}
|
||||
|
||||
//load all rom's on startup to the UI
|
||||
void loadRoms(){
|
||||
void loadAllRoms(){
|
||||
System.out.println("loading all rom's on startup to mwc ...");
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
|
|
|
@ -110,6 +110,10 @@ public class GoogleDriveController {
|
|||
}
|
||||
|
||||
public void sync(String cemuDirectory) throws IOException {
|
||||
//in case there is no folderID saved, look it up first
|
||||
if (getFolderID() == "" || getFolderID() == null) {
|
||||
getSavegamesFolderID();
|
||||
}
|
||||
getLocalSavegames();
|
||||
getCloudSavegames();
|
||||
|
||||
|
@ -207,6 +211,20 @@ public class GoogleDriveController {
|
|||
}
|
||||
}
|
||||
|
||||
private void getSavegamesFolderID() throws IOException {
|
||||
Files.List request = service.files().list().setQ("mimeType = 'application/vnd.google-apps.folder' and name = 'cemu_savegames'");
|
||||
FileList files = request.execute();
|
||||
|
||||
try {
|
||||
System.out.println("FolderID: " + files.getFiles().get(0).getId());
|
||||
setFolderID(files.getFiles().get(0).getId());
|
||||
} catch (Exception e) {
|
||||
System.out.println("Oops, something went wrong! It seems that you have more than one folder called 'cemu_savegames'!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//upload a file to the cloud from the local savegames folder
|
||||
public void uploadFile(java.io.File uploadFile) throws IOException{
|
||||
System.out.println("uploading " + uploadFile.getName() + "...");
|
||||
|
@ -261,6 +279,7 @@ public class GoogleDriveController {
|
|||
System.out.println("finished uploading all files!");
|
||||
} catch (IOException e) {
|
||||
//Auto-generated catch block
|
||||
System.out.println("Oops, there went something wrong! Error during uploading all files.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 114 B |
Binary file not shown.
After Width: | Height: | Size: 116 B |
Loading…
Reference in New Issue