Merge branch 'master' into v4.1.x

This commit is contained in:
Gravit 2018-11-26 18:21:53 +07:00
commit 8597206e84
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
5 changed files with 19 additions and 13 deletions

View file

@ -70,8 +70,9 @@ var settingsOverlay = {
// Set new result // Set new result
var newDir = chooser.showDialog(stage); var newDir = chooser.showDialog(stage);
if (newDir !== null) { if (newDir !== null) {
settingsOverlay.transferCatalogDialog(); settingsOverlay.transferCatalogDialog(newDir.toPath());
settings.updatesDir = newDir.toPath(); settings.updatesDir = newDir.toPath();
DirBridge.dirUpdates = settings.updatesDir;
settingsOverlay.updateDirLabel(); settingsOverlay.updateDirLabel();
} }
}); });
@ -137,11 +138,12 @@ var settingsOverlay = {
holder.lookup("#apply").setOnAction(function(event) overlay.hide(0, null)); holder.lookup("#apply").setOnAction(function(event) overlay.hide(0, null));
}, },
transferCatalogDialog: function() { transferCatalogDialog: function(newDir) {
settingsOverlay.transferDialog.setVisible(true); settingsOverlay.transferDialog.setVisible(true);
settingsOverlay.transferDialog.lookup("#cancelTransfer").setOnAction(function(event) settingsOverlay.transferDialog.setVisible(false)); settingsOverlay.transferDialog.lookup("#cancelTransfer").setOnAction(function(event) settingsOverlay.transferDialog.setVisible(false));
settingsOverlay.transferDialog.lookup("#applyTransfer").setOnAction(function(event) { settingsOverlay.transferDialog.lookup("#applyTransfer").setOnAction(function(event) {
//Здесь могла быть ваша реклама, либо DirBridge.move(); //Здесь могла быть ваша реклама, либо DirBridge.move();
DirBridge.move(newDir);
settingsOverlay.transferDialog.setVisible(false); settingsOverlay.transferDialog.setVisible(false);
}); });
}, },

View file

@ -1,7 +1,9 @@
package ru.gravit.launcher; package ru.gravit.launcher;
import ru.gravit.launcher.LauncherAPI; import ru.gravit.launcher.LauncherAPI;
import ru.gravit.utils.helper.IOHelper;
import java.io.IOException;
import java.nio.file.Path; import java.nio.file.Path;
public class DirBridge { public class DirBridge {
@ -11,5 +13,10 @@ public class DirBridge {
public static Path dirUpdates; public static Path dirUpdates;
@LauncherAPI @LauncherAPI
public static Path defaultUpdatesDir; public static Path defaultUpdatesDir;
@LauncherAPI
public static void move(Path newDir) throws IOException
{
IOHelper.move(dirUpdates,newDir);
dirUpdates = newDir;
}
} }

View file

@ -97,6 +97,7 @@ public void read(HInput input) throws IOException, SignatureException {
// Client settings // Client settings
updatesDir = IOHelper.toPath(input.readString(0)); updatesDir = IOHelper.toPath(input.readString(0));
DirBridge.dirUpdates = updatesDir;
autoEnter = input.readBoolean(); autoEnter = input.readBoolean();
fullScreen = input.readBoolean(); fullScreen = input.readBoolean();
setRAM(input.readLength(JVMHelper.RAM)); setRAM(input.readLength(JVMHelper.RAM));

View file

@ -364,9 +364,13 @@ else if (isDownloadJava) {
Collections.addAll(args, profile.object.getJvmArgs()); Collections.addAll(args, profile.object.getJvmArgs());
Collections.addAll(args, "-Djava.library.path=".concat(params.clientDir.resolve(NATIVES_DIR).toString())); // Add Native Path Collections.addAll(args, "-Djava.library.path=".concat(params.clientDir.resolve(NATIVES_DIR).toString())); // Add Native Path
Collections.addAll(args, "-javaagent:".concat(pathLauncher)); Collections.addAll(args, "-javaagent:".concat(pathLauncher));
Collections.addAll(args, "-classpath", pathLauncher);
if(wrapper) if(wrapper)
Collections.addAll(args, "-Djava.class.path=".concat(pathLauncher)); // Add Class Path Collections.addAll(args, "-Djava.class.path=".concat(pathLauncher)); // Add Class Path
else
{
Collections.addAll(args, "-cp");
Collections.addAll(args, pathLauncher);
}
Collections.addAll(args, ClientLauncher.class.getName()); Collections.addAll(args, ClientLauncher.class.getName());
// Print commandline debug message // Print commandline debug message

View file

@ -32,14 +32,6 @@ public final class Launcher {
// Used to determine from clientside is launched from launcher // Used to determine from clientside is launched from launcher
public static final AtomicBoolean LAUNCHED = new AtomicBoolean(false); public static final AtomicBoolean LAUNCHED = new AtomicBoolean(false);
static int readBuildNumber() {
try {
return Integer.valueOf(IOHelper.request(IOHelper.getResourceURL("buildnumber")));
} catch (IOException ignored) {
return 0; // Maybe dev env?
}
}
private static final AtomicReference<LauncherConfig> CONFIG = new AtomicReference<>(); private static final AtomicReference<LauncherConfig> CONFIG = new AtomicReference<>();
@LauncherAPI @LauncherAPI
public static ModulesManagerInterface modulesManager = null; public static ModulesManagerInterface modulesManager = null;
@ -67,7 +59,7 @@ static int readBuildNumber() {
public static int MAJOR = 4; public static int MAJOR = 4;
public static int MINOR = 0; public static int MINOR = 0;
public static int PATCH = 8; public static int PATCH = 8;
public static int BUILD = readBuildNumber(); public static int BUILD = 0;
public static Version.Type RELEASE = Version.Type.STABLE; public static Version.Type RELEASE = Version.Type.STABLE;
@LauncherAPI @LauncherAPI