Merge branch 'master' into 1.1

# Conflicts:
#	src/main/java/Controller.java
This commit is contained in:
Jeddunk 2020-05-10 18:50:13 +02:00
commit 1447e8a0b8
6 changed files with 26 additions and 20 deletions

View File

@ -12,12 +12,14 @@ Set your game automatically up for use with CreamAPI.
## Installation
**Make sure you have Java 8 installed.**
Download the latest release and extract it into any folder (e.g. `%USERPROFILE%\Desktop\auto-cream-api`).
Download the latest release and extract it into any folder (e.g. `%USERPROFILE%\Desktop\auto-cream-api`).
*The included CreamAPI version may be outdated, get the most recent version and
**extract the DLL files from the nonlog_build folder to the Auto-CreamAPI folder!***
## Usage
* Double-click `auto-cream-api.jar` to open the application. (When starting it for the first time, it might take a few
seconds since it needs to cache a list of games available on the Steam Store.)
* Double-click `auto-cream-api.jar` to open the application. (When starting it for the first time, it might take a few
seconds since it needs to cache a list of games available on the Steam Store.)
* Alternatively, open a CMD window in the location of the application, and run it by entering the following:
```shell script
java -jar auto-cream-api.jar

View File

@ -1,10 +1,10 @@
import com.jfoenix.controls.*;
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView;
import javafx.beans.value.ChangeListener;
import javafx.collections.FXCollections;
import javafx.concurrent.Service;
import javafx.concurrent.Task;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Label;
import javafx.scene.control.Tooltip;
import javafx.stage.FileChooser;
@ -30,7 +30,21 @@ public class Controller {
private static final String REGEX = "(?<steamApiDll>steam_api(?:64)?.dll)$";
public FontAwesomeIconView creamApiDllAppliedIcon;
public FontAwesomeIconView creamApiConfigExists;
private final CreamApiDllHandler handler = CreamApiDllHandler.getInstance();
private CreamApiDllHandler handler = null;
{
try {
handler = CreamApiDllHandler.getInstance();
} catch (IOException e) {
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("CreamAPI DLLs missing!");
alert.setHeaderText("CreamAPI DLL files can't be found!");
alert.setContentText("Please download CreamAPI and extract the non-log " +
"version in the same folder as Auto-CreamAPI!\nThe program will now close.");
alert.showAndWait();
System.exit(10);
}
}
private final CreamApiConfig config = CreamApiConfig.getInstance();
private final SteamAppsListCache cache = new SteamAppsListCache();
@FXML
@ -73,7 +87,6 @@ public class Controller {
generate_tooltips();
fix_dlc_textarea_prompt_text();
reset(true);
state_label.setText("Ready.");
}
private void read() {

View File

@ -15,24 +15,14 @@ public class CreamApiDllHandler {
private final String steamApiDllMd5;
private final String steamApi64DllMd5;
private CreamApiDllHandler() {
String steamApiDllMd5 = "";
String steamApi64DllMd5 = "";
try {
steamApiDllMd5 = DigestUtils.md5Hex(Files.newInputStream(steamApiDllPath));
} catch (IOException e) {
System.err.println("File missing: " + steamApiDllPath.toAbsolutePath().toString());
}
try {
steamApi64DllMd5 = DigestUtils.md5Hex(Files.newInputStream(steamApi64DllPath));
} catch (IOException e) {
System.err.println("File missing: " + steamApi64DllPath.toAbsolutePath().toString());
}
private CreamApiDllHandler() throws IOException {
String steamApiDllMd5 = DigestUtils.md5Hex(Files.newInputStream(steamApiDllPath));
String steamApi64DllMd5 = DigestUtils.md5Hex(Files.newInputStream(steamApi64DllPath));
this.steamApiDllMd5 = steamApiDllMd5;
this.steamApi64DllMd5 = steamApi64DllMd5;
}
public static synchronized CreamApiDllHandler getInstance() {
public static synchronized CreamApiDllHandler getInstance() throws IOException {
if (creamApiDllHandlerInstance == null) {
creamApiDllHandlerInstance = new CreamApiDllHandler();
}

Binary file not shown.

Binary file not shown.

1
version.txt Normal file
View File

@ -0,0 +1 @@
4.4.0.0