Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
c83f3233d1 | |||
ca70940fcf | |||
a6e4899854 | |||
02fc213887 | |||
20835d4611 | |||
1b828d6e4b | |||
fe88271c90 | |||
4ce6c06d2f | |||
224e4e6eec | |||
5c3cb8398f | |||
bb72ed04ee | |||
e3c30e8a22 | |||
1b5bcceeeb | |||
1ed7400a02 | |||
95cbf91a7f | |||
e91892f552 | |||
7611030f81 | |||
fc66188893 | |||
9ab7b61cd9 | |||
65b716cb77 | |||
1011dc4c2c |
@ -3,9 +3,7 @@
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/>
|
||||
<classpathentry kind="lib" path="src/libraries/sqlite-jdbc-3.16.1.jar"/>
|
||||
<classpathentry kind="lib" path="src/libraries/commons-io-2.5.jar"/>
|
||||
<classpathentry kind="lib" path="src/libraries/jfoenix-1.3.0.jar"/>
|
||||
<classpathentry kind="lib" path="src/libraries/google_apis/google-api-client-1.22.0.jar"/>
|
||||
<classpathentry kind="lib" path="src/libraries/google_apis/google-api-services-drive-v3-rev68-1.22.0.jar"/>
|
||||
<classpathentry kind="lib" path="src/libraries/google_apis/google-http-client-1.22.0.jar"/>
|
||||
@ -18,5 +16,11 @@
|
||||
<classpathentry kind="lib" path="src/libraries/google_apis/jetty-util-6.1.25.jar"/>
|
||||
<classpathentry kind="lib" path="src/libraries/google_apis/jackson-core-2.8.8.jar"/>
|
||||
<classpathentry kind="lib" path="src/libraries/commons-codec-1.10.jar"/>
|
||||
<classpathentry kind="lib" path="src/libraries/jfoenix-1.4.0.jar"/>
|
||||
<classpathentry kind="lib" path="src/libraries/sqlite-jdbc-3.18.0.jar"/>
|
||||
<classpathentry kind="lib" path="src/libraries/minimal-json-0.9.4.jar"/>
|
||||
<classpathentry kind="lib" path="src/libraries/junrar-0.7.jar"/>
|
||||
<classpathentry kind="lib" path="src/libraries/commons-logging-api-1.1.jar"/>
|
||||
<classpathentry kind="lib" path="src/libraries/commons-vfs2-2.1.1744488.2.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
@ -1,5 +1,6 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
|
@ -5,6 +5,8 @@ cemu_UI is a simple, material design graphical frontend for [cemu](http://cemu.i
|
||||
## installation
|
||||
Simply download the cemu_UI.jar from [releases](https://github.com/Seil0/cemu_UI/releases), make sure you have the latest version of java 8 oracle jre/jdk installed, open the file. cemu_UI creats a new directory "C:\Users\USERNAME\Documents\cemu_UI", where the database, settings and covers are stored. **first start can take while!**
|
||||
|
||||
If you want to use the cloud sync function read the [wiki](https://github.com/Seil0/cemu_UI/wiki#cloud-savegame-syncronisation) carefully!
|
||||
|
||||
## building from source
|
||||
1. read the [license](https://github.com/Seil0/cemu_UI/blob/master/LICENSE)
|
||||
2. download/clone the git repository
|
||||
@ -19,13 +21,13 @@ Simply download the cemu_UI.jar from [releases](https://github.com/Seil0/cemu_UI
|
||||
* easyer way to add updates & DLCs (only adding not downloading!)
|
||||
* automatic rom detection (only .rpx files with a app.xml)
|
||||
* customisable UI
|
||||
* [sync savegames via google drive](https://github.com/Seil0/cemu_UI/wiki)
|
||||
|
||||
## planed Features (no ETA)
|
||||
## [planed Features](https://github.com/Seil0/cemu_UI/projects/1) (no ETA)
|
||||
|
||||
* Controller support
|
||||
* more UI improvements
|
||||
* support more rom file formats in automatic detection
|
||||
* [sync savegames via google drive](https://github.com/Seil0/cemu_UI/wiki)
|
||||
* [smmdb api](http://smmdb.ddns.net/api) integration
|
||||
|
||||
### If you have another idea, make a "new issue" with the `idea` lable
|
||||
|
1
bin/.gitignore
vendored
@ -1,2 +1 @@
|
||||
/cloudControllerInstances/
|
||||
/application/
|
||||
|
BIN
bin/application/CloudController$3.class
Normal file
@ -5,13 +5,16 @@
|
||||
<?import com.jfoenix.controls.JFXHamburger?>
|
||||
<?import com.jfoenix.controls.JFXTextField?>
|
||||
<?import com.jfoenix.controls.JFXToggleButton?>
|
||||
<?import com.jfoenix.controls.JFXTreeTableView?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.ScrollPane?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
<?import javafx.scene.text.TextFlow?>
|
||||
|
||||
<AnchorPane prefHeight="600.0" prefWidth="892.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.MainWindowController">
|
||||
<children>
|
||||
@ -30,22 +33,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 +61,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 +85,26 @@
|
||||
<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">
|
||||
<children>
|
||||
<JFXTreeTableView fx:id="courseTreeTable" layoutX="14.0" layoutY="14.0" prefHeight="537.0" prefWidth="405.0" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="14.0" />
|
||||
<ImageView fx:id="smmdbImageView" fitHeight="150.0" fitWidth="267.0" layoutX="436.0" layoutY="14.0" pickOnBounds="true" preserveRatio="true" AnchorPane.leftAnchor="436.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="14.0" />
|
||||
<ScrollPane fx:id="smmdbScrollPane" layoutX="436.0" layoutY="181.0" prefHeight="290.0" prefWidth="267.0" AnchorPane.bottomAnchor="91.0" AnchorPane.leftAnchor="436.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="181.0">
|
||||
<content>
|
||||
<TextFlow fx:id="smmdbTextFlow" maxWidth="265.0" prefWidth="265.0" />
|
||||
</content>
|
||||
</ScrollPane>
|
||||
<JFXButton fx:id="smmdbDownloadBtn" buttonType="RAISED" layoutX="436.0" layoutY="479.0" onAction="#smmdbDownloadBtnAction" prefHeight="38.0" prefWidth="267.0" text="download" AnchorPane.bottomAnchor="45.0" AnchorPane.leftAnchor="436.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="479.0">
|
||||
<font>
|
||||
<Font name="System Bold" size="14.0" />
|
||||
</font>
|
||||
</JFXButton>
|
||||
<Label fx:id="helpLabel" layoutX="436.0" layoutY="538.0" prefHeight="17.0" prefWidth="267.0" text="please help me improving this! click me!">
|
||||
<font>
|
||||
<Font size="14.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children></AnchorPane>
|
||||
<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" />
|
||||
|
@ -1,4 +1,86 @@
|
||||
.jfx-hamburgerW StackPane { -fx-background-color: white;
|
||||
-fx-background-radius: 5px; }
|
||||
.jfx-hamburgerB StackPane { -fx-background-color: black;
|
||||
-fx-background-radius: 5px; }
|
||||
/*
|
||||
* HAMBURGER CSS
|
||||
*/
|
||||
|
||||
.jfx-hamburgerW StackPane {
|
||||
-fx-background-color: white;
|
||||
-fx-background-radius: 5px;
|
||||
}
|
||||
|
||||
.jfx-hamburgerB StackPane {
|
||||
-fx-background-color: black;
|
||||
-fx-background-radius: 5px;
|
||||
}
|
||||
|
||||
/*
|
||||
* TREE TABLE CSS
|
||||
*/
|
||||
|
||||
.tree-table-view {
|
||||
-fx-tree-table-color: rgba(0, 168, 204, 0.2);
|
||||
-fx-tree-table-rippler-color: rgba(0, 168, 204, 0.4);
|
||||
}
|
||||
|
||||
.tree-table-view:focused .tree-table-row-cell:selected {
|
||||
-fx-background-color: -fx-tree-table-color;
|
||||
-fx-table-cell-border-color: -fx-tree-table-color;
|
||||
-fx-text-fill: BLACK;
|
||||
}
|
||||
|
||||
.tree-table-view:focused .tree-table-row-cell:selected .tree-table-cell {
|
||||
-fx-text-fill: BLACK;
|
||||
}
|
||||
|
||||
.tree-table-view .jfx-rippler {
|
||||
-jfx-rippler-fill: -fx-tree-table-rippler-color;
|
||||
}
|
||||
|
||||
.tree-table-view .column-header,
|
||||
.tree-table-view .column-header-background,
|
||||
.tree-table-view .column-header-background .filler {
|
||||
-fx-background-color: TRANSPARENT;
|
||||
}
|
||||
|
||||
.tree-table-view .column-header {
|
||||
-fx-border-width: 0 1 0 1;
|
||||
-fx-border-color: #F3F3F3;
|
||||
}
|
||||
|
||||
.tree-table-view .column-header .label {
|
||||
-fx-text-fill: #949494;
|
||||
-fx-padding: 16 0 16 0;
|
||||
}
|
||||
|
||||
.tree-table-view .column-header .arrow, .tree-table-view .column-header .sort-order-dot {
|
||||
-fx-background-color: #949494;
|
||||
}
|
||||
|
||||
.tree-table-view .column-header:last-visible {
|
||||
-fx-border-width: 0 2 0 1;
|
||||
}
|
||||
|
||||
.tree-table-view .column-header-background {
|
||||
-fx-border-width: 0 0.0 1 0;
|
||||
-fx-border-color: #F3F3F3;
|
||||
}
|
||||
|
||||
.tree-table-view .tree-table-cell {
|
||||
-fx-border-width: 0 0 0 0;
|
||||
-fx-padding: 16 0 16 0;
|
||||
}
|
||||
|
||||
.tree-table-view .column-overlay {
|
||||
-fx-background-color: -fx-tree-table-color;
|
||||
}
|
||||
|
||||
.tree-table-view .column-resize-line, .tree-table-view .column-drag-header {
|
||||
-fx-background-color: -fx-tree-table-rippler-color;
|
||||
}
|
||||
|
||||
.tree-table-view:focused {
|
||||
-fx-background-color: -fx-tree-table-color, -fx-box-border, -fx-control-inner-background;
|
||||
-fx-background-insets: -1.4, 0, 1;
|
||||
-fx-background-radius: 1.4, 0, 0;
|
||||
/*....*/
|
||||
-fx-padding: 1; /* 0.083333em; */
|
||||
}
|
BIN
bin/datatypes/CourseTableDataType.class
Normal file
BIN
bin/datatypes/SmmdbApiDataType.class
Normal file
BIN
bin/datatypes/UIROMDataType.class
Normal file
BIN
bin/libraries/commons-logging-api-1.1.jar
Normal file
BIN
bin/libraries/commons-vfs2-2.1.1744488.2.jar
Normal file
BIN
bin/libraries/junrar-0.7.jar
Normal file
BIN
bin/libraries/minimal-json-0.9.4.jar
Normal file
BIN
bin/libraries/sqlite-jdbc-3.18.0.jar
Normal file
BIN
bin/resources/icons/close_black_2048x2048.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 233 B |
Before Width: | Height: | Size: 235 B After Width: | Height: | Size: 235 B |
Before Width: | Height: | Size: 245 B After Width: | Height: | Size: 245 B |
BIN
bin/resources/icons/ic_get_app_black_24dp_1x.png
Normal file
After Width: | Height: | Size: 114 B |
BIN
bin/resources/icons/ic_get_app_white_24dp_1x.png
Normal file
After Width: | Height: | Size: 116 B |
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 232 B |
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 322 B |
Before Width: | Height: | Size: 326 B After Width: | Height: | Size: 326 B |
@ -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")) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public class Main extends Application {
|
||||
AnchorPane pane = loader.load();
|
||||
primaryStage.setResizable(false);
|
||||
primaryStage.setTitle("cemu_UI");
|
||||
// primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream("/recources/Homeflix_Icon_64x64.png"))); //adds application icon
|
||||
// primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream("/resources/Homeflix_Icon_64x64.png"))); //adds application icon
|
||||
|
||||
mainWindowController = loader.getController(); //Link of FXMLController and controller class
|
||||
mainWindowController.setMain(this); //call setMain
|
||||
|
@ -5,13 +5,16 @@
|
||||
<?import com.jfoenix.controls.JFXHamburger?>
|
||||
<?import com.jfoenix.controls.JFXTextField?>
|
||||
<?import com.jfoenix.controls.JFXToggleButton?>
|
||||
<?import com.jfoenix.controls.JFXTreeTableView?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.ScrollPane?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
<?import javafx.scene.text.TextFlow?>
|
||||
|
||||
<AnchorPane prefHeight="600.0" prefWidth="892.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.MainWindowController">
|
||||
<children>
|
||||
@ -30,22 +33,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 +61,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 +85,26 @@
|
||||
<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">
|
||||
<children>
|
||||
<JFXTreeTableView fx:id="courseTreeTable" layoutX="14.0" layoutY="14.0" prefHeight="537.0" prefWidth="405.0" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="14.0" />
|
||||
<ImageView fx:id="smmdbImageView" fitHeight="150.0" fitWidth="267.0" layoutX="436.0" layoutY="14.0" pickOnBounds="true" preserveRatio="true" AnchorPane.leftAnchor="436.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="14.0" />
|
||||
<ScrollPane fx:id="smmdbScrollPane" layoutX="436.0" layoutY="181.0" prefHeight="290.0" prefWidth="267.0" AnchorPane.bottomAnchor="91.0" AnchorPane.leftAnchor="436.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="181.0">
|
||||
<content>
|
||||
<TextFlow fx:id="smmdbTextFlow" maxWidth="265.0" prefWidth="265.0" />
|
||||
</content>
|
||||
</ScrollPane>
|
||||
<JFXButton fx:id="smmdbDownloadBtn" buttonType="RAISED" layoutX="436.0" layoutY="479.0" onAction="#smmdbDownloadBtnAction" prefHeight="38.0" prefWidth="267.0" text="download" AnchorPane.bottomAnchor="45.0" AnchorPane.leftAnchor="436.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="479.0">
|
||||
<font>
|
||||
<Font name="System Bold" size="14.0" />
|
||||
</font>
|
||||
</JFXButton>
|
||||
<Label fx:id="helpLabel" layoutX="436.0" layoutY="538.0" prefHeight="17.0" prefWidth="267.0" text="please help me improving this! click me!">
|
||||
<font>
|
||||
<Font size="14.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children></AnchorPane>
|
||||
<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" />
|
||||
|
@ -13,6 +13,7 @@
|
||||
*/
|
||||
package application;
|
||||
|
||||
import java.awt.Desktop;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
@ -22,24 +23,44 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.math.BigInteger;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.sql.SQLException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.ProgressMonitor;
|
||||
import javax.swing.ProgressMonitorInputStream;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import com.github.junrar.Archive;
|
||||
import com.github.junrar.exception.RarException;
|
||||
import com.github.junrar.impl.FileVolumeManager;
|
||||
import com.github.junrar.rarfile.FileHeader;
|
||||
import com.jfoenix.controls.JFXButton;
|
||||
import com.jfoenix.controls.JFXColorPicker;
|
||||
import com.jfoenix.controls.JFXHamburger;
|
||||
import com.jfoenix.controls.JFXTextField;
|
||||
import com.jfoenix.controls.JFXToggleButton;
|
||||
import com.jfoenix.controls.JFXTreeTableColumn;
|
||||
import com.jfoenix.controls.JFXTreeTableView;
|
||||
import com.jfoenix.transitions.hamburger.HamburgerBackArrowBasicTransition;
|
||||
|
||||
import datatypes.CourseTableDataType;
|
||||
import datatypes.SmmdbApiDataType;
|
||||
import datatypes.UIROMDataType;
|
||||
import javafx.animation.FadeTransition;
|
||||
import javafx.animation.ParallelTransition;
|
||||
import javafx.animation.TranslateTransition;
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.event.ActionEvent;
|
||||
@ -54,8 +75,10 @@ import javafx.scene.control.Label;
|
||||
import javafx.scene.control.MenuItem;
|
||||
import javafx.scene.control.ScrollPane;
|
||||
import javafx.scene.control.TextInputDialog;
|
||||
import javafx.scene.control.TreeItem;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.input.MouseButton;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.HBox;
|
||||
@ -64,6 +87,8 @@ import javafx.scene.paint.Color;
|
||||
import javafx.scene.paint.Paint;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.scene.text.FontWeight;
|
||||
import javafx.scene.text.Text;
|
||||
import javafx.scene.text.TextFlow;
|
||||
import javafx.stage.DirectoryChooser;
|
||||
import javafx.stage.FileChooser;
|
||||
import javafx.util.Duration;
|
||||
@ -82,20 +107,26 @@ public class MainWindowController {
|
||||
@FXML
|
||||
private JFXButton reloadRomsBtn;
|
||||
|
||||
@FXML
|
||||
private JFXButton smmdbBtn;
|
||||
|
||||
@FXML
|
||||
private JFXButton cemuTFBtn;
|
||||
|
||||
@FXML
|
||||
private JFXButton romTFBtn;
|
||||
|
||||
@FXML
|
||||
private JFXButton smmdbDownloadBtn;
|
||||
|
||||
@FXML
|
||||
private JFXButton playBtn;
|
||||
|
||||
@FXML
|
||||
JFXButton timePlayedBtn;
|
||||
private JFXButton lastTimePlayedBtn;
|
||||
|
||||
@FXML
|
||||
private JFXButton lastTimePlayedBtn;
|
||||
JFXButton timePlayedBtn;
|
||||
|
||||
@FXML
|
||||
private JFXHamburger menuHam;
|
||||
@ -106,6 +137,9 @@ public class MainWindowController {
|
||||
@FXML
|
||||
private JFXTextField romTextField;
|
||||
|
||||
@FXML
|
||||
private TextFlow smmdbTextFlow;
|
||||
|
||||
@FXML
|
||||
private JFXColorPicker colorPicker;
|
||||
|
||||
@ -118,40 +152,75 @@ public class MainWindowController {
|
||||
@FXML
|
||||
private AnchorPane settingsAnchorPane;
|
||||
|
||||
@FXML
|
||||
private AnchorPane smmdbAnchorPane;
|
||||
|
||||
@FXML
|
||||
private AnchorPane gamesAnchorPane;
|
||||
|
||||
@FXML
|
||||
private ScrollPane scrollPaneMain;
|
||||
|
||||
@FXML
|
||||
private ScrollPane smmdbScrollPane;
|
||||
|
||||
@FXML
|
||||
private VBox sideMenuVBox;
|
||||
|
||||
@FXML
|
||||
private HBox topHBox;
|
||||
|
||||
@FXML
|
||||
private ImageView smmdbImageView;
|
||||
|
||||
@FXML
|
||||
private Label helpLabel;
|
||||
|
||||
|
||||
@FXML
|
||||
private JFXTreeTableView<CourseTableDataType> courseTreeTable = new JFXTreeTableView<CourseTableDataType>();
|
||||
|
||||
@FXML
|
||||
TreeItem<CourseTableDataType> root = new TreeItem<>(new CourseTableDataType("",0,0,0));
|
||||
|
||||
@FXML
|
||||
private JFXTreeTableColumn<CourseTableDataType, String> titleColumn = new JFXTreeTableColumn<>("title");
|
||||
|
||||
@FXML
|
||||
private JFXTreeTableColumn<CourseTableDataType, Integer> starsColumn = new JFXTreeTableColumn<>("stars");
|
||||
|
||||
@FXML
|
||||
private JFXTreeTableColumn<CourseTableDataType, Integer> downloadsColumn = new JFXTreeTableColumn<>("downloads");
|
||||
|
||||
@FXML
|
||||
private JFXTreeTableColumn<CourseTableDataType, Integer> idColumn = new JFXTreeTableColumn<>("id");
|
||||
|
||||
Main main;
|
||||
dbController dbController;
|
||||
SmmdbApiQuery smmdbApiQuery;
|
||||
playGame playGame;
|
||||
private boolean menuTrue = false;
|
||||
private boolean settingsTrue = false;
|
||||
private boolean playTrue = false;
|
||||
private boolean smmdbTrue = 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;
|
||||
private String selectedGameTitleID;
|
||||
private String selectedGameTitle;
|
||||
private String color;
|
||||
private String version = "0.1.5";
|
||||
private String buildNumber = "015";
|
||||
private String versionName = "Gusty Garden";
|
||||
private String version = "0.1.6";
|
||||
private String buildNumber = "027";
|
||||
private String versionName = "Throwback Galaxy";
|
||||
private int xPos = -200;
|
||||
private int yPos = 17;
|
||||
private int xPosHelper;
|
||||
private int selectedUIDataIndex;
|
||||
private int selected;
|
||||
private int id;
|
||||
private DirectoryChooser directoryChooser = new DirectoryChooser();
|
||||
private File dirWin = new File(System.getProperty("user.home") + "/Documents/cemu_UI");
|
||||
private File dirLinux = new File(System.getProperty("user.home") + "/cemu_UI");
|
||||
@ -159,7 +228,11 @@ public class MainWindowController {
|
||||
private File fileLinux = new File(dirLinux + "/config.xml");
|
||||
File pictureCacheWin = new File(dirWin+"/picture_cache");
|
||||
File pictureCacheLinux = new File(dirLinux+"/picture_cache");
|
||||
private ObservableList<uiDataType> games = FXCollections.observableArrayList();
|
||||
private ObservableList<String> smmIDs = FXCollections.observableArrayList("fe31b7f2"); //TODO add more IDs
|
||||
private ObservableList<UIROMDataType> games = FXCollections.observableArrayList();
|
||||
ObservableList<SmmdbApiDataType> courses = FXCollections.observableArrayList();
|
||||
ArrayList<Text> courseText = new ArrayList<Text>();
|
||||
ArrayList<Text> nameText = new ArrayList<Text>();
|
||||
Properties props = new Properties();
|
||||
Properties gameProps = new Properties();
|
||||
private MenuItem edit = new MenuItem("edit");
|
||||
@ -169,20 +242,25 @@ public class MainWindowController {
|
||||
private ContextMenu gameContextMenu = new ContextMenu(edit, remove, update, addDLC);
|
||||
private Label lastGameLabel = new Label();
|
||||
|
||||
private ImageView add_circle_black = new ImageView(new Image("recources/icons/ic_add_circle_black_24dp_1x.png"));
|
||||
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 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 add_circle_black = new ImageView(new Image("resources/icons/ic_add_circle_black_24dp_1x.png"));
|
||||
private ImageView info_black = new ImageView(new Image("resources/icons/ic_info_black_24dp_1x.png"));
|
||||
private ImageView settings_black = new ImageView(new Image("resources/icons/ic_settings_black_24dp_1x.png"));
|
||||
private ImageView cached_black = new ImageView(new Image("resources/icons/ic_cached_black_24dp_1x.png"));
|
||||
private ImageView smmdb_black = new ImageView(new Image("resources/icons/ic_get_app_black_24dp_1x.png"));
|
||||
private ImageView add_circle_white = new ImageView(new Image("resources/icons/ic_add_circle_white_24dp_1x.png"));
|
||||
private ImageView info_white = new ImageView(new Image("resources/icons/ic_info_white_24dp_1x.png"));
|
||||
private ImageView settings_white = new ImageView(new Image("resources/icons/ic_settings_white_24dp_1x.png"));
|
||||
private ImageView cached_white = new ImageView(new Image("resources/icons/ic_cached_white_24dp_1x.png"));
|
||||
private ImageView smmdb_white = new ImageView(new Image("resources/icons/ic_get_app_white_24dp_1x.png"));
|
||||
private Image close_black = new Image("resources/icons/close_black_2048x2048.png");
|
||||
|
||||
public void setMain(Main main) {
|
||||
this.main = main;
|
||||
dbController = new dbController(this);
|
||||
smmdbApiQuery = new SmmdbApiQuery();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked") //FIXME SuppressWarnings
|
||||
void initUI(){
|
||||
cemuTextField.setText(cemuPath);
|
||||
romTextField.setText(romPath);
|
||||
@ -191,6 +269,23 @@ public class MainWindowController {
|
||||
cloudSyncToggleBtn.setSelected(isCloudSync());
|
||||
edit.setDisable(true);
|
||||
applyColor();
|
||||
|
||||
//initialize courseTable
|
||||
titleColumn.setPrefWidth(160);
|
||||
downloadsColumn.setPrefWidth(127);
|
||||
starsColumn.setPrefWidth(100);
|
||||
|
||||
courseTreeTable.setRoot(root);
|
||||
courseTreeTable.setShowRoot(false);
|
||||
courseTreeTable.setEditable(false);
|
||||
|
||||
titleColumn.setCellValueFactory(cellData -> cellData.getValue().getValue().title);
|
||||
starsColumn.setCellValueFactory(cellData -> cellData.getValue().getValue().stars.asObject());
|
||||
downloadsColumn.setCellValueFactory(cellData -> cellData.getValue().getValue().downloads.asObject());
|
||||
idColumn.setCellValueFactory(cellData -> cellData.getValue().getValue().id.asObject());
|
||||
|
||||
courseTreeTable.getColumns().setAll(titleColumn, downloadsColumn, starsColumn, idColumn);
|
||||
courseTreeTable.getColumns().get(3).setVisible(false); //hide idColumn (important)
|
||||
}
|
||||
|
||||
void initActions() {
|
||||
@ -198,26 +293,31 @@ public class MainWindowController {
|
||||
|
||||
HamburgerBackArrowBasicTransition burgerTask = new HamburgerBackArrowBasicTransition(menuHam);
|
||||
menuHam.addEventHandler(MouseEvent.MOUSE_PRESSED, (e)->{
|
||||
if(playTrue){
|
||||
if (playTrue) {
|
||||
playBtnSlideOut();
|
||||
}
|
||||
if(menuTrue == false){
|
||||
sideMenuSlideIn();
|
||||
burgerTask.setRate(1.0);
|
||||
burgerTask.play();
|
||||
menuTrue = true;
|
||||
}else{
|
||||
if (menuTrue){
|
||||
sideMenuSlideOut();
|
||||
burgerTask.setRate(-1.0);
|
||||
burgerTask.play();
|
||||
menuTrue = false;
|
||||
}else{
|
||||
sideMenuSlideIn();
|
||||
burgerTask.setRate(1.0);
|
||||
burgerTask.play();
|
||||
menuTrue = true;
|
||||
}
|
||||
if(settingsTrue == true){
|
||||
if (settingsTrue) {
|
||||
settingsAnchorPane.setVisible(false);
|
||||
// setPath(tfPath.getText());
|
||||
saveSettings();
|
||||
settingsTrue = false;
|
||||
}
|
||||
if (smmdbTrue) {
|
||||
smmdbAnchorPane.setVisible(false);
|
||||
smmdbTrue = false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
edit.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@ -233,13 +333,14 @@ public class MainWindowController {
|
||||
alert.initOwner(main.primaryStage);
|
||||
alert.showAndWait();
|
||||
}else{
|
||||
System.out.println("show edit window TODO!"); //TODO
|
||||
System.out.println("show edit window TODO!"); //TODO show edit window
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
remove.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
@SuppressWarnings("unlikely-arg-type") //FIXME SuppressWarnings("unlikely-arg-type")
|
||||
@Override
|
||||
public void handle(ActionEvent event) {
|
||||
System.out.println("remove "+selectedGameTitleID);
|
||||
if(selectedGameTitleID == null){
|
||||
@ -269,12 +370,13 @@ public class MainWindowController {
|
||||
//remove game from database
|
||||
games.remove(selectedUIDataIndex);
|
||||
dbController.removeRom(selectedGameTitleID);
|
||||
//remove all games form gamesAnchorPane (UI)
|
||||
gamesAnchorPane.getChildren().removeAll(games);
|
||||
//reset position
|
||||
xPos = -200;
|
||||
yPos = 17;
|
||||
xPosHelper = 0;
|
||||
//add all games to gamesAnchorPane
|
||||
//add all games to gamesAnchorPane (UI)
|
||||
for(int i=0; i< games.size(); i++){
|
||||
generatePosition();
|
||||
games.get(i).getVBox().setLayoutX(getxPos());
|
||||
@ -419,6 +521,48 @@ public class MainWindowController {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//Change-listener for TreeTable
|
||||
courseTreeTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Object>() {
|
||||
@Override
|
||||
public void changed(ObservableValue<?> observable, Object oldVal, Object newVal){
|
||||
selected = courseTreeTable.getSelectionModel().getSelectedIndex(); //get selected item
|
||||
id = idColumn.getCellData(selected); //get name of selected item
|
||||
|
||||
for (int i = 0; i < courses.size(); i++) {
|
||||
if (courses.get(i).getId() == id) {
|
||||
|
||||
if (courses.get(i).getHasimage() == 1) {
|
||||
try {
|
||||
URL url = new URL("http://smmdb.ddns.net/img/courses/thumbnails/" + id + ".pic");
|
||||
Image image = new Image(url.toURI().toString());
|
||||
smmdbImageView.setImage(image);
|
||||
} catch (MalformedURLException | URISyntaxException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
smmdbImageView.setImage(close_black);
|
||||
}
|
||||
addCourseDescription(courses.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
helpLabel.setOnMouseClicked(new EventHandler<MouseEvent>() {
|
||||
@Override
|
||||
public void handle(MouseEvent mouseEvent) {
|
||||
if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){
|
||||
System.out.println("I'll help you");
|
||||
try {
|
||||
Desktop.getDesktop().browse(new URI("https://github.com/Seil0/cemu_UI/issues/3"));
|
||||
} catch (IOException | URISyntaxException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
System.out.println("initializing Actions done!");
|
||||
}
|
||||
|
||||
@ -439,13 +583,17 @@ public class MainWindowController {
|
||||
|
||||
@FXML
|
||||
void settingsBtnAction(ActionEvent event) {
|
||||
if(settingsTrue == false){
|
||||
if (smmdbTrue) {
|
||||
smmdbAnchorPane.setVisible(false);
|
||||
smmdbTrue = false;
|
||||
}
|
||||
if (settingsTrue) {
|
||||
settingsAnchorPane.setVisible(false);
|
||||
settingsTrue = false;
|
||||
saveSettings();
|
||||
} else {
|
||||
settingsAnchorPane.setVisible(true);
|
||||
settingsTrue = true;
|
||||
}else{
|
||||
settingsAnchorPane.setVisible(false);
|
||||
saveSettings();
|
||||
settingsTrue = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -457,6 +605,32 @@ public class MainWindowController {
|
||||
System.exit(0); //finishes itself
|
||||
}
|
||||
|
||||
@FXML
|
||||
void smmdbBtnAction() {
|
||||
//show smmdbAnchorPane
|
||||
if (smmdbTrue) {
|
||||
smmdbAnchorPane.setVisible(false);
|
||||
smmdbTrue = false;
|
||||
} else {
|
||||
smmdbAnchorPane.setVisible(true);
|
||||
smmdbTrue = true;
|
||||
}
|
||||
|
||||
//start query
|
||||
courses.addAll(smmdbApiQuery.startQuery());
|
||||
|
||||
System.out.println("size: " + courses.size());
|
||||
System.out.println(courses.get(3).getNintendoid());
|
||||
|
||||
//add query response to courseTreeTable
|
||||
for(int i = 0; i < courses.size(); i++){
|
||||
CourseTableDataType helpCourse = new CourseTableDataType(courses.get(i).getTitle(), courses.get(i).getDownloads(),
|
||||
courses.get(i).getStars(), courses.get(i).getId());
|
||||
|
||||
root.getChildren().add(new TreeItem<CourseTableDataType>(helpCourse)); //add data to root-node
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
void playBtnAction(ActionEvent event) throws InterruptedException, IOException{
|
||||
dbController.setLastPlayed(selectedGameTitleID);
|
||||
@ -513,16 +687,80 @@ public class MainWindowController {
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
void smmdbDownloadBtnAction(ActionEvent event){
|
||||
String downloadUrl = "http://smmdb.ddns.net/courses/" + id;
|
||||
String downloadFileURL = getCemuPath() + "/" + id + ".rar"; //getCemuPath() + "/" + smmID + "/" + id + ".rar"
|
||||
String outputFile = getCemuPath() + "/";
|
||||
|
||||
try {
|
||||
HttpURLConnection conn = (HttpURLConnection) new URL(downloadUrl).openConnection();
|
||||
ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(null, "Downloading...", conn.getInputStream());
|
||||
ProgressMonitor pm = pmis.getProgressMonitor();
|
||||
pm.setMillisToDecideToPopup(0);
|
||||
pm.setMillisToPopup(0);
|
||||
pm.setMinimum(0); // tell the progress bar that we start at the beginning of the stream
|
||||
pm.setMaximum(conn.getContentLength()); // tell the progress bar the total number of bytes we are going to read.
|
||||
FileUtils.copyInputStreamToFile(pmis, new File(downloadFileURL)); //download file + "/mlc01/emulatorSave"
|
||||
pmis.close();
|
||||
System.out.println("downloaded successfull");
|
||||
|
||||
File downloadFile = new File(downloadFileURL);
|
||||
Archive a = null;
|
||||
try {
|
||||
a = new Archive(new FileVolumeManager(downloadFile));
|
||||
} catch (RarException | IOException e) {
|
||||
// Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (a != null) {
|
||||
a.getMainHeader().print();
|
||||
FileHeader fh = a.nextFileHeader();
|
||||
|
||||
for (int i = 0; i < smmIDs.size(); i++) {
|
||||
if (new File(outputFile + "mlc01/emulatorSave/" + smmIDs.get(i)).exists()) {
|
||||
File courseDirectory = new File(outputFile + "mlc01/emulatorSave/" + smmIDs.get(0) + "/" + fh.getFileNameString().substring(0, fh.getFileNameString().indexOf('\\')));
|
||||
System.out.println("Path: " + courseDirectory.getAbsolutePath());
|
||||
if (!courseDirectory.exists()) {
|
||||
courseDirectory.mkdir();
|
||||
}
|
||||
while (fh != null) {
|
||||
try {
|
||||
File out = new File(outputFile + "mlc01/emulatorSave/" + smmIDs.get(0) + "/" + fh.getFileNameString().trim());
|
||||
if (!out.getAbsolutePath().equals(courseDirectory.getAbsolutePath())) {
|
||||
System.out.println(out.getAbsolutePath());
|
||||
FileOutputStream os = new FileOutputStream(out);
|
||||
a.extractFile(fh, os);
|
||||
os.close();
|
||||
}
|
||||
|
||||
} catch (RarException | IOException e) {
|
||||
// Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
fh = a.nextFileHeader();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
a.close();
|
||||
downloadFile.delete();
|
||||
} catch (IOException e) {
|
||||
System.err.println("something went wrong during downloading the course");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@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 +770,7 @@ public class MainWindowController {
|
||||
}else{
|
||||
fullscreen = true;
|
||||
}
|
||||
saveSettings();//TODO remove (only save on exit settings)
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
@FXML
|
||||
@ -548,6 +786,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 +795,7 @@ public class MainWindowController {
|
||||
}
|
||||
|
||||
}
|
||||
saveSettings();//TODO remove (only save on exit settings)
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
@FXML
|
||||
@ -666,11 +906,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 +946,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;
|
||||
@ -708,10 +957,12 @@ public class MainWindowController {
|
||||
selectedGameTitleID = titleID;
|
||||
selectedGameTitle = title;
|
||||
|
||||
//underling selected Label
|
||||
lastGameLabel.setStyle("-fx-underline: false;");
|
||||
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");
|
||||
@ -737,24 +988,119 @@ public class MainWindowController {
|
||||
timePlayedBtn.setText(dbController.getTimePlayed(titleID)+ " min");
|
||||
}
|
||||
}
|
||||
|
||||
if(playTrue == false){
|
||||
|
||||
if (!playTrue) {
|
||||
playBtnSlideIn();
|
||||
}
|
||||
if (menuTrue) {
|
||||
sideMenuSlideOut();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
games.add(new uiDataType(VBox, gameTitleLabel, gameBtn, titleID, romPath));
|
||||
games.add(new UIROMDataType(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());
|
||||
}
|
||||
}
|
||||
|
||||
private void addCourseDescription(SmmdbApiDataType course) {
|
||||
String coursetype;
|
||||
String leveltype;
|
||||
String difficulty;
|
||||
smmdbTextFlow.getChildren().remove(0, smmdbTextFlow.getChildren().size());
|
||||
nameText.clear();
|
||||
courseText.clear();
|
||||
|
||||
switch (course.getCoursetype()) {
|
||||
case 0:
|
||||
coursetype = "Creation";
|
||||
break;
|
||||
case 1:
|
||||
coursetype = "Recreation";
|
||||
break;
|
||||
case 2:
|
||||
coursetype = "Wii U Dump";
|
||||
break;
|
||||
default:
|
||||
coursetype = "notset";
|
||||
break;
|
||||
}
|
||||
|
||||
switch (course.getLeveltype()) {
|
||||
case 0:
|
||||
leveltype = "NSMBU";
|
||||
break;
|
||||
case 1:
|
||||
leveltype = "SMW";
|
||||
break;
|
||||
case 2:
|
||||
leveltype = "SMB3";
|
||||
break;
|
||||
case 3:
|
||||
leveltype = "SMB";
|
||||
break;
|
||||
case 4:
|
||||
leveltype = "Mixed";
|
||||
break;
|
||||
default:
|
||||
leveltype = "notset";
|
||||
break;
|
||||
}
|
||||
|
||||
switch (course.getDifficulty()) {
|
||||
case 0:
|
||||
difficulty = "Easy";
|
||||
break;
|
||||
case 1:
|
||||
difficulty = "Normal";
|
||||
break;
|
||||
case 2:
|
||||
difficulty = "Expert";
|
||||
break;
|
||||
case 3:
|
||||
difficulty = "Super Expert";
|
||||
break;
|
||||
case 4:
|
||||
difficulty = "Mixed";
|
||||
break;
|
||||
default:
|
||||
difficulty = "notset";
|
||||
break;
|
||||
}
|
||||
|
||||
nameText.add(0, new Text("title" + ": "));
|
||||
nameText.add(1, new Text("owner" + ": "));
|
||||
nameText.add(2, new Text("coursetype" + ": "));
|
||||
nameText.add(3, new Text("leveltype" + ": "));
|
||||
nameText.add(4, new Text("difficulty" + ": "));
|
||||
nameText.add(5, new Text("lastmodified" + ": "));
|
||||
nameText.add(6, new Text("uploaded" + ": "));
|
||||
nameText.add(7, new Text("nintendoid" + ": "));
|
||||
|
||||
courseText.add(0, new Text(course.getTitle() + "\n"));
|
||||
courseText.add(1, new Text(Integer.toString(course.getOwner()) + "\n"));
|
||||
courseText.add(2, new Text(coursetype + "\n"));
|
||||
courseText.add(3, new Text(leveltype + "\n"));
|
||||
courseText.add(4, new Text(difficulty + "\n"));
|
||||
courseText.add(5, new Text(new java.util.Date((long)course.getLastmodified()*1000) + "\n"));
|
||||
courseText.add(6, new Text(new java.util.Date((long)course.getUploaded()*1000) + "\n"));
|
||||
courseText.add(7, new Text(course.getNintendoid() + "\n"));
|
||||
|
||||
for(int i=0; i<nameText.size(); i++){
|
||||
nameText.get(i).setFont(Font.font ("System", FontWeight.BOLD, 14));
|
||||
courseText.get(i).setFont(Font.font ("System", 14));
|
||||
smmdbTextFlow.getChildren().addAll(nameText.get(i),courseText.get(i));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//TODO xPosHelper based on window with
|
||||
private void generatePosition(){
|
||||
private void generatePosition() {
|
||||
// System.out.println(main.primaryStage.getWidth());
|
||||
if(xPosHelper == 4){
|
||||
xPos = 17;
|
||||
@ -766,13 +1112,12 @@ public class MainWindowController {
|
||||
}
|
||||
}
|
||||
|
||||
private void applyColor(){
|
||||
private void applyColor() {
|
||||
String boxStyle = "-fx-background-color: #"+getColor()+";";
|
||||
String btnStyleBlack = "-fx-button-type: RAISED; -fx-background-color: #"+getColor()+"; -fx-text-fill: BLACK;";
|
||||
String btnStyleWhite = "-fx-button-type: RAISED; -fx-background-color: #"+getColor()+"; -fx-text-fill: WHITE;";
|
||||
BigInteger icolor = new BigInteger(getColor(),16);
|
||||
BigInteger ccolor = new BigInteger("78909cff",16);
|
||||
getColor();
|
||||
|
||||
sideMenuVBox.setStyle(boxStyle);
|
||||
topHBox.setStyle(boxStyle);
|
||||
@ -784,15 +1129,18 @@ 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);
|
||||
smmdbDownloadBtn.setStyle(btnStyleWhite);
|
||||
playBtn.setStyle(btnStyleWhite);
|
||||
|
||||
aboutBtn.setGraphic(info_white);
|
||||
settingsBtn.setGraphic(settings_white);
|
||||
addBtn.setGraphic(add_circle_white);
|
||||
reloadRomsBtn.setGraphic(cached_white);
|
||||
smmdbBtn.setGraphic(smmdb_white);
|
||||
|
||||
menuHam.getStyleClass().add("jfx-hamburgerW");
|
||||
}else{
|
||||
@ -800,15 +1148,18 @@ 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);
|
||||
smmdbDownloadBtn.setStyle(btnStyleBlack);
|
||||
playBtn.setStyle(btnStyleBlack);
|
||||
|
||||
aboutBtn.setGraphic(info_black);
|
||||
settingsBtn.setGraphic(settings_black);
|
||||
addBtn.setGraphic(add_circle_black);
|
||||
reloadRomsBtn.setGraphic(cached_black);
|
||||
smmdbBtn.setGraphic(smmdb_black);
|
||||
|
||||
menuHam.getStyleClass().add("jfx-hamburgerB");
|
||||
}
|
||||
@ -827,6 +1178,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 +1208,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!");
|
||||
@ -943,6 +1296,18 @@ public class MainWindowController {
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private String hexToRgb() {
|
||||
System.out.println(getColor());
|
||||
int hex = Integer.parseInt(getColor().substring(0, 5), 16);
|
||||
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
return r + ", " + g + ", " + b;
|
||||
}
|
||||
|
||||
private static BufferedImage resizeImage(BufferedImage originalImage, int type, int imgWidth, int imgHeigth) {
|
||||
BufferedImage resizedImage = new BufferedImage(imgWidth, imgHeigth, type);
|
||||
Graphics2D g = resizedImage.createGraphics();
|
||||
|
@ -1,4 +1,86 @@
|
||||
.jfx-hamburgerW StackPane { -fx-background-color: white;
|
||||
-fx-background-radius: 5px; }
|
||||
.jfx-hamburgerB StackPane { -fx-background-color: black;
|
||||
-fx-background-radius: 5px; }
|
||||
/*
|
||||
* HAMBURGER CSS
|
||||
*/
|
||||
|
||||
.jfx-hamburgerW StackPane {
|
||||
-fx-background-color: white;
|
||||
-fx-background-radius: 5px;
|
||||
}
|
||||
|
||||
.jfx-hamburgerB StackPane {
|
||||
-fx-background-color: black;
|
||||
-fx-background-radius: 5px;
|
||||
}
|
||||
|
||||
/*
|
||||
* TREE TABLE CSS
|
||||
*/
|
||||
|
||||
.tree-table-view {
|
||||
-fx-tree-table-color: rgba(0, 168, 204, 0.2);
|
||||
-fx-tree-table-rippler-color: rgba(0, 168, 204, 0.4);
|
||||
}
|
||||
|
||||
.tree-table-view:focused .tree-table-row-cell:selected {
|
||||
-fx-background-color: -fx-tree-table-color;
|
||||
-fx-table-cell-border-color: -fx-tree-table-color;
|
||||
-fx-text-fill: BLACK;
|
||||
}
|
||||
|
||||
.tree-table-view:focused .tree-table-row-cell:selected .tree-table-cell {
|
||||
-fx-text-fill: BLACK;
|
||||
}
|
||||
|
||||
.tree-table-view .jfx-rippler {
|
||||
-jfx-rippler-fill: -fx-tree-table-rippler-color;
|
||||
}
|
||||
|
||||
.tree-table-view .column-header,
|
||||
.tree-table-view .column-header-background,
|
||||
.tree-table-view .column-header-background .filler {
|
||||
-fx-background-color: TRANSPARENT;
|
||||
}
|
||||
|
||||
.tree-table-view .column-header {
|
||||
-fx-border-width: 0 1 0 1;
|
||||
-fx-border-color: #F3F3F3;
|
||||
}
|
||||
|
||||
.tree-table-view .column-header .label {
|
||||
-fx-text-fill: #949494;
|
||||
-fx-padding: 16 0 16 0;
|
||||
}
|
||||
|
||||
.tree-table-view .column-header .arrow, .tree-table-view .column-header .sort-order-dot {
|
||||
-fx-background-color: #949494;
|
||||
}
|
||||
|
||||
.tree-table-view .column-header:last-visible {
|
||||
-fx-border-width: 0 2 0 1;
|
||||
}
|
||||
|
||||
.tree-table-view .column-header-background {
|
||||
-fx-border-width: 0 0.0 1 0;
|
||||
-fx-border-color: #F3F3F3;
|
||||
}
|
||||
|
||||
.tree-table-view .tree-table-cell {
|
||||
-fx-border-width: 0 0 0 0;
|
||||
-fx-padding: 16 0 16 0;
|
||||
}
|
||||
|
||||
.tree-table-view .column-overlay {
|
||||
-fx-background-color: -fx-tree-table-color;
|
||||
}
|
||||
|
||||
.tree-table-view .column-resize-line, .tree-table-view .column-drag-header {
|
||||
-fx-background-color: -fx-tree-table-rippler-color;
|
||||
}
|
||||
|
||||
.tree-table-view:focused {
|
||||
-fx-background-color: -fx-tree-table-color, -fx-box-border, -fx-control-inner-background;
|
||||
-fx-background-insets: -1.4, 0, 1;
|
||||
-fx-background-radius: 1.4, 0, 0;
|
||||
/*....*/
|
||||
-fx-padding: 1; /* 0.083333em; */
|
||||
}
|
135
src/application/SmmdbApiQuery.java
Normal file
@ -0,0 +1,135 @@
|
||||
/**
|
||||
* smmdbapi query
|
||||
* api query, return all courses as ArrayList
|
||||
*/
|
||||
package application;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import com.eclipsesource.json.Json;
|
||||
import com.eclipsesource.json.JsonArray;
|
||||
import com.eclipsesource.json.JsonObject;
|
||||
import com.eclipsesource.json.JsonValue;
|
||||
|
||||
import datatypes.SmmdbApiDataType;
|
||||
|
||||
public class SmmdbApiQuery {
|
||||
|
||||
private String URL = "http://smmdb.ddns.net/api/getcourses?";
|
||||
|
||||
public SmmdbApiQuery() {
|
||||
//Auto-generated constructor stub
|
||||
}
|
||||
|
||||
//start api query
|
||||
public ArrayList<SmmdbApiDataType> startQuery() {
|
||||
ArrayList<Integer> courseIDs = new ArrayList<>();
|
||||
ArrayList<SmmdbApiDataType> course = new ArrayList<>();
|
||||
String output = "";
|
||||
|
||||
|
||||
try {
|
||||
URL apiUrl = new URL(URL);
|
||||
BufferedReader ina = new BufferedReader(new InputStreamReader(apiUrl.openStream()));
|
||||
output = ina.readLine();
|
||||
ina.close();
|
||||
} catch (IOException e) {
|
||||
System.out.println("error while making api request or reading response");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
JsonObject mainObject = Json.parse(output).asObject().get("courses").asObject();
|
||||
JsonArray objectAssets = Json.parse(output).asObject().get("order").asArray();
|
||||
|
||||
for (JsonValue asset : objectAssets) {
|
||||
courseIDs.add(asset.asInt());
|
||||
}
|
||||
|
||||
//if value is 9 or "notset" the api returned NULL as value
|
||||
for (int i = 0; i < courseIDs.size(); i++) {
|
||||
int id, owner, coursetype, leveltype, difficulty, lastmodified, uploaded, downloads, stars, hasimage, ispackage, updatereq;
|
||||
String nintendoid, title;
|
||||
JsonObject singleObject = mainObject.get(courseIDs.get(i).toString()).asObject();
|
||||
|
||||
try {
|
||||
id = singleObject.getInt("id", 0);
|
||||
} catch (Exception e) {
|
||||
id = 9;
|
||||
}
|
||||
try {
|
||||
owner = singleObject.getInt("owner", 0);
|
||||
} catch (Exception e) {
|
||||
owner = 9;
|
||||
}
|
||||
try {
|
||||
coursetype = singleObject.getInt("coursetype", 0);
|
||||
} catch (Exception e) {
|
||||
coursetype = 9;
|
||||
}
|
||||
try {
|
||||
leveltype = singleObject.getInt("leveltype", 0);
|
||||
} catch (Exception e) {
|
||||
leveltype = 9;
|
||||
}
|
||||
try {
|
||||
difficulty = singleObject.getInt("difficulty", 0);
|
||||
} catch (Exception e) {
|
||||
difficulty = 9;
|
||||
}
|
||||
try {
|
||||
lastmodified = singleObject.getInt("lastmodified", 0);
|
||||
} catch (Exception e) {
|
||||
lastmodified = 9;
|
||||
}
|
||||
try {
|
||||
uploaded = singleObject.getInt("uploaded", 0);
|
||||
} catch (Exception e) {
|
||||
uploaded = 9;
|
||||
}
|
||||
try {
|
||||
downloads = singleObject.getInt("downloads", 0);
|
||||
} catch (Exception e) {
|
||||
downloads = 9;
|
||||
}
|
||||
try {
|
||||
stars = singleObject.getInt("stars", 0);
|
||||
} catch (Exception e) {
|
||||
stars = 9;
|
||||
}
|
||||
try {
|
||||
hasimage = singleObject.getInt("hasimage", 0);
|
||||
} catch (Exception e) {
|
||||
hasimage = 9;
|
||||
}
|
||||
try {
|
||||
ispackage = singleObject.getInt("ispackage", 0);
|
||||
} catch (Exception e) {
|
||||
ispackage = 9;
|
||||
}
|
||||
try {
|
||||
updatereq = singleObject.getInt("updatereq", 0);
|
||||
} catch (Exception e) {
|
||||
updatereq = 9;
|
||||
}
|
||||
try {
|
||||
nintendoid = singleObject.getString("nintendoid", "");
|
||||
} catch (Exception e) {
|
||||
nintendoid = "notset";
|
||||
}
|
||||
try {
|
||||
title = singleObject.getString("title", "");;
|
||||
} catch (Exception e) {
|
||||
title = "notset";
|
||||
}
|
||||
|
||||
course.add(new SmmdbApiDataType(id, owner, coursetype, leveltype, difficulty, lastmodified, uploaded, downloads,
|
||||
stars, hasimage, ispackage, updatereq, nintendoid, title));
|
||||
}
|
||||
|
||||
return course;
|
||||
}
|
||||
|
||||
}
|
@ -53,7 +53,7 @@ public class dbController {
|
||||
loadRomDatabase();
|
||||
loadGamesDatabase();
|
||||
createRomDatabase();
|
||||
loadRoms();
|
||||
loadAllRoms();
|
||||
checkRemoveEntry();
|
||||
System.out.println("<==========finished loading sql==========>");
|
||||
}
|
||||
@ -96,7 +96,7 @@ public class dbController {
|
||||
System.out.println("games database loaded successfull");
|
||||
}
|
||||
|
||||
//creating database, if db has 0 entries search for all .rpx files in the roms directory and add them
|
||||
//creating database, if database has 0 entries search for all .rpx files in the roms directory and add them
|
||||
void createRomDatabase() {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
@ -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();
|
||||
|
@ -77,7 +77,7 @@ public class GoogleDriveController {
|
||||
*/
|
||||
public Credential authorize() throws IOException {
|
||||
// Load client secrets.
|
||||
InputStream in = getClass().getClassLoader().getResourceAsStream("recources/client_secret.json");
|
||||
InputStream in = getClass().getClassLoader().getResourceAsStream("resources/client_secret.json");
|
||||
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));
|
||||
|
||||
// Build flow and trigger user authorization request.
|
||||
@ -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();
|
||||
|
||||
@ -182,10 +186,10 @@ public class GoogleDriveController {
|
||||
//reading all local savegames
|
||||
private void getLocalSavegames() throws IOException {
|
||||
java.io.File dir = new java.io.File(cemuDirectory+"/mlc01/emulatorSave");
|
||||
String[] extensions = new String[] { "dat" };
|
||||
String[] extensions = new String[] { "dat","sav","bin" };
|
||||
localSavegames.removeAll(localSavegames);
|
||||
localSavegamesName.removeAll(localSavegamesName);
|
||||
System.out.println("Getting all .dat files in " + dir.getCanonicalPath()+" including those in subdirectories");
|
||||
System.out.println("Getting all dat,sav,bin files in " + dir.getCanonicalPath()+" including those in subdirectories");
|
||||
List<java.io.File> files = (List<java.io.File>) FileUtils.listFiles(dir, extensions, true);
|
||||
for (java.io.File file : files) {
|
||||
localSavegamesName.add(file.getParentFile().getName()+"_"+file.getName());
|
||||
@ -198,14 +202,28 @@ public class GoogleDriveController {
|
||||
System.out.println("getting all cloud savegames");
|
||||
cloudSavegames.removeAll(cloudSavegames);
|
||||
cloudSavegamesName.removeAll(cloudSavegamesName);
|
||||
Files.List request = service.files().list().setQ("fileExtension = 'dat' and '"+folderID+"' in parents").setFields("nextPageToken, files(id, name, size, modifiedTime, createdTime, md5Checksum)");
|
||||
Files.List request = service.files().list().setQ("'"+folderID+"' in parents").setFields("nextPageToken, files(id, name, size, modifiedTime, createdTime, md5Checksum)");
|
||||
FileList files = request.execute();
|
||||
|
||||
for (File file : files.getFiles()) {
|
||||
cloudSavegamesName.add(file.getName());
|
||||
cloudSavegames.add(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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{
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
26
src/datatypes/CourseTableDataType.java
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Datatype used in the TreeTableview for
|
||||
*/
|
||||
package datatypes;
|
||||
|
||||
import com.jfoenix.controls.datamodels.treetable.RecursiveTreeObject;
|
||||
|
||||
import javafx.beans.property.IntegerProperty;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
|
||||
public class CourseTableDataType extends RecursiveTreeObject<CourseTableDataType> {
|
||||
|
||||
public final StringProperty title;
|
||||
public final IntegerProperty downloads;
|
||||
public final IntegerProperty stars;
|
||||
public final IntegerProperty id;
|
||||
|
||||
public CourseTableDataType(String title, int downloads, int stars, int id) {
|
||||
this.title = new SimpleStringProperty(title);
|
||||
this.downloads = new SimpleIntegerProperty(downloads);
|
||||
this.stars = new SimpleIntegerProperty(stars);
|
||||
this.id = new SimpleIntegerProperty(id);
|
||||
}
|
||||
}
|
215
src/datatypes/SmmdbApiDataType.java
Normal file
@ -0,0 +1,215 @@
|
||||
/**
|
||||
* Datatype used for the smmdbapi query
|
||||
*/
|
||||
package datatypes;
|
||||
|
||||
import javafx.beans.property.IntegerProperty;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
|
||||
public class SmmdbApiDataType {
|
||||
|
||||
private final IntegerProperty id = new SimpleIntegerProperty();
|
||||
private final IntegerProperty owner = new SimpleIntegerProperty();
|
||||
private final IntegerProperty coursetype = new SimpleIntegerProperty();
|
||||
private final IntegerProperty leveltype = new SimpleIntegerProperty();
|
||||
private final IntegerProperty difficulty = new SimpleIntegerProperty();
|
||||
private final IntegerProperty lastmodified = new SimpleIntegerProperty();
|
||||
private final IntegerProperty uploaded = new SimpleIntegerProperty();
|
||||
private final IntegerProperty downloads = new SimpleIntegerProperty();
|
||||
private final IntegerProperty stars = new SimpleIntegerProperty();
|
||||
private final IntegerProperty hasimage = new SimpleIntegerProperty();
|
||||
private final IntegerProperty ispackage = new SimpleIntegerProperty();
|
||||
private final IntegerProperty updatereq = new SimpleIntegerProperty();
|
||||
private final StringProperty nintendoid = new SimpleStringProperty();
|
||||
private final StringProperty title = new SimpleStringProperty();
|
||||
|
||||
public SmmdbApiDataType(final int id, final int owner, final int coursetype, final int leveltype, final int difficulty,
|
||||
final int lastmodified, final int uploaded, final int downloads, final int stars, final int hasimage,
|
||||
final int ispackage, final int updatereq, final String nintendoid, final String title) {
|
||||
this.id.set(id);
|
||||
this.owner.set(owner);
|
||||
this.coursetype.set(coursetype);
|
||||
this.leveltype.set(leveltype);
|
||||
this.difficulty.set(difficulty);
|
||||
this.lastmodified.set(lastmodified);
|
||||
this.uploaded.set(uploaded);
|
||||
this.downloads.set(downloads);
|
||||
this.stars.set(stars);
|
||||
this.hasimage.set(hasimage);
|
||||
this.ispackage.set(ispackage);
|
||||
this.updatereq.set(updatereq);
|
||||
this.nintendoid.set(nintendoid);
|
||||
this.title.set(title);
|
||||
}
|
||||
|
||||
public IntegerProperty idProperty(){
|
||||
return id;
|
||||
}
|
||||
|
||||
public IntegerProperty ownerProperty(){
|
||||
return owner;
|
||||
}
|
||||
|
||||
public IntegerProperty coursetypeProperty(){
|
||||
return coursetype;
|
||||
}
|
||||
|
||||
public StringProperty nintendoidProperty(){
|
||||
return nintendoid;
|
||||
}
|
||||
|
||||
public IntegerProperty leveltypeProperty(){
|
||||
return leveltype;
|
||||
}
|
||||
|
||||
public IntegerProperty difficultyProperty(){
|
||||
return difficulty;
|
||||
}
|
||||
|
||||
public IntegerProperty lastmodifiedProperty(){
|
||||
return lastmodified;
|
||||
}
|
||||
|
||||
public IntegerProperty uploadedProperty(){
|
||||
return uploaded;
|
||||
}
|
||||
|
||||
public IntegerProperty downloadsProperty(){
|
||||
return downloads;
|
||||
}
|
||||
|
||||
public IntegerProperty starsProperty(){
|
||||
return stars;
|
||||
}
|
||||
|
||||
public IntegerProperty hasimageProperty(){
|
||||
return hasimage;
|
||||
}
|
||||
|
||||
public IntegerProperty ispackageProperty(){
|
||||
return ispackage;
|
||||
}
|
||||
|
||||
public IntegerProperty updatereqProperty(){
|
||||
return updatereq;
|
||||
}
|
||||
|
||||
public StringProperty titleProperty(){
|
||||
return title;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return idProperty().get();
|
||||
}
|
||||
|
||||
public int getOwner() {
|
||||
return ownerProperty().get();
|
||||
}
|
||||
|
||||
public int getCoursetype() {
|
||||
return coursetypeProperty().get();
|
||||
}
|
||||
|
||||
public int getLeveltype() {
|
||||
return leveltypeProperty().get();
|
||||
}
|
||||
|
||||
public int getDifficulty() {
|
||||
return difficultyProperty().get();
|
||||
}
|
||||
|
||||
public int getLastmodified() {
|
||||
return lastmodifiedProperty().get();
|
||||
}
|
||||
|
||||
public int getUploaded() {
|
||||
return uploadedProperty().get();
|
||||
}
|
||||
|
||||
public int getDownloads() {
|
||||
return downloadsProperty().get();
|
||||
}
|
||||
|
||||
public int getStars() {
|
||||
return starsProperty().get();
|
||||
}
|
||||
|
||||
public int getHasimage() {
|
||||
return hasimageProperty().get();
|
||||
}
|
||||
|
||||
public int getIspackage() {
|
||||
return ispackageProperty().get();
|
||||
}
|
||||
|
||||
public int getUpdatereq() {
|
||||
return updatereqProperty().get();
|
||||
}
|
||||
|
||||
public String getNintendoid() {
|
||||
return nintendoidProperty().get();
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return titleProperty().get();
|
||||
}
|
||||
|
||||
public final void setId(int id) {
|
||||
idProperty().set(id);
|
||||
}
|
||||
|
||||
public final void setOwner(int owner) {
|
||||
ownerProperty().set(owner);
|
||||
}
|
||||
|
||||
public final void setCoursetype(int coursetype) {
|
||||
coursetypeProperty().set(coursetype);
|
||||
}
|
||||
|
||||
public final void setLeveltype(int leveltype) {
|
||||
leveltypeProperty().set(leveltype);
|
||||
}
|
||||
|
||||
public final void setDifficulty(int difficulty) {
|
||||
difficultyProperty().set(difficulty);
|
||||
}
|
||||
|
||||
public final void setLastmodified(int lastmodified) {
|
||||
lastmodifiedProperty().set(lastmodified);
|
||||
}
|
||||
|
||||
public final void setUploaded(int uploaded) {
|
||||
uploadedProperty().set(uploaded);
|
||||
}
|
||||
|
||||
public final void setDownloads(int downloads) {
|
||||
downloadsProperty().set(downloads);
|
||||
}
|
||||
|
||||
public final void setStars(int stars) {
|
||||
starsProperty().set(stars);
|
||||
}
|
||||
|
||||
public final void setHasimage(int hasimage) {
|
||||
hasimageProperty().set(hasimage);
|
||||
}
|
||||
|
||||
public final void setIspackage(int ispackage) {
|
||||
ispackageProperty().set(ispackage);
|
||||
}
|
||||
|
||||
public final void setUpdatereq(int updatereq) {
|
||||
updatereqProperty().set(updatereq);
|
||||
}
|
||||
|
||||
public final void setNintendoid(String nintendoid) {
|
||||
nintendoidProperty().set(nintendoid);
|
||||
}
|
||||
|
||||
public final void setTitle(String title) {
|
||||
titleProperty().set(title);
|
||||
}
|
||||
|
||||
}
|
@ -1,4 +1,7 @@
|
||||
package application;
|
||||
/**
|
||||
* Datatype used for UI ROM elements
|
||||
*/
|
||||
package datatypes;
|
||||
|
||||
import com.jfoenix.controls.JFXButton;
|
||||
|
||||
@ -8,15 +11,15 @@ import javafx.beans.property.StringProperty;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.VBox;
|
||||
|
||||
public class uiDataType {
|
||||
|
||||
public class UIROMDataType {
|
||||
|
||||
private final SimpleObjectProperty<VBox> vBox = new SimpleObjectProperty<>();
|
||||
private final SimpleObjectProperty<Label> label = new SimpleObjectProperty<>();
|
||||
private final SimpleObjectProperty<JFXButton> button = new SimpleObjectProperty<>();
|
||||
private final StringProperty titleID = new SimpleStringProperty();
|
||||
private final StringProperty romPath = new SimpleStringProperty();
|
||||
|
||||
public uiDataType (final VBox vBox, final Label label, final JFXButton button, final String titleID, final String romPath){
|
||||
public UIROMDataType (final VBox vBox, final Label label, final JFXButton button, final String titleID, final String romPath){
|
||||
this.vBox.set(vBox);
|
||||
this.label.set(label);
|
||||
this.button.set(button);
|
BIN
src/libraries/commons-logging-api-1.1.jar
Normal file
BIN
src/libraries/commons-vfs2-2.1.1744488.2.jar
Normal file
BIN
src/libraries/junrar-0.7.jar
Normal file
BIN
src/libraries/minimal-json-0.9.4.jar
Normal file
BIN
src/libraries/sqlite-jdbc-3.18.0.jar
Normal file
BIN
src/resources/icons/close_black_2048x2048.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 233 B |
Before Width: | Height: | Size: 235 B After Width: | Height: | Size: 235 B |
Before Width: | Height: | Size: 245 B After Width: | Height: | Size: 245 B |
BIN
src/resources/icons/ic_get_app_black_24dp_1x.png
Normal file
After Width: | Height: | Size: 114 B |
BIN
src/resources/icons/ic_get_app_white_24dp_1x.png
Normal file
After Width: | Height: | Size: 116 B |
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 232 B |
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 322 B |
Before Width: | Height: | Size: 326 B After Width: | Height: | Size: 326 B |