diff --git a/Launcher/runtime/config.js b/Launcher/runtime/config.js index 5dabe0d..54d885a 100755 --- a/Launcher/runtime/config.js +++ b/Launcher/runtime/config.js @@ -10,7 +10,7 @@ linkURL: new java.net.URL("http://bit.ly/1SP0Rl8"), // URL for link under "Auth" button // Settings defaults - settingsMagic: 0xBEEF, // Ancient magic, don't touch + settingsMagic: 0xC0DE5, // Ancient magic, don't touch autoEnterDefault: false, // Should autoEnter be enabled by default? fullScreenDefault: false, // Should fullScreen be enabled by default? ramDefault: 1024, // Default RAM amount (0 for auto) @@ -23,10 +23,10 @@ // ====== DON'T TOUCH! ====== // var dir = IOHelper.HOME_DIR.resolve(config.dir); -if(!IOHelper.isDir(dir)) { +if (!IOHelper.isDir(dir)) { java.nio.file.Files.createDirectory(dir); } -var updatesDir = dir.resolve("updates"); -if(!IOHelper.isDir(updatesDir)) { - java.nio.file.Files.createDirectory(updatesDir); +var defaultUpdatesDir = dir.resolve("updates"); +if (!IOHelper.isDir(defaultUpdatesDir)) { + java.nio.file.Files.createDirectory(defaultUpdatesDir); } diff --git a/Launcher/runtime/dialog/dialog.js b/Launcher/runtime/dialog/dialog.js index 0e3bba3..c41b662 100755 --- a/Launcher/runtime/dialog/dialog.js +++ b/Launcher/runtime/dialog/dialog.js @@ -33,14 +33,14 @@ // Lookup login field loginField = pane.lookup("#login"); loginField.setOnAction(goAuth); - if(settings.login !== null) { + if (settings.login !== null) { loginField.setText(settings.login); } // Lookup password field passwordField = pane.lookup("#password"); passwordField.setOnAction(goAuth); - if(settings.rsaPassword !== null) { + if (settings.rsaPassword !== null) { passwordField.getStyleClass().add("hasSaved"); passwordField.setPromptText("*** Сохранённый ***"); } @@ -67,28 +67,28 @@ /* ======== Handler functions ======== */ function goAuth(event) { // Verify there's no other overlays - if(overlay.current !== null) { + if (overlay.current !== null) { return; } // Get profile var profile = profilesBox.getSelectionModel().getSelectedItem(); - if(profile === null) { + if (profile === null) { return; // No profile selected } // Get login var login = loginField.getText(); - if(login.isEmpty()) { + if (login.isEmpty()) { return; // Maybe throw exception?) } // Get password var rsaPassword; var password = passwordField.getText(); - if(!password.isEmpty()) { + if (!password.isEmpty()) { rsaPassword = settings.setPassword(password); - } else if(settings.rsaPassword !== null) { + } else if (settings.rsaPassword !== null) { rsaPassword = settings.rsaPassword; } else { return; // No password - no auth, sorry :C @@ -104,7 +104,7 @@ function goSettings(event) { // Verify there's no other overlays - if(overlay.current !== null) { + if (overlay.current !== null) { return; } @@ -112,7 +112,7 @@ overlay.show(settings.overlay, null); } -/* ======== Processing functions ======== */ +/* ======== Processing functions ======== */ function verifyLauncher(e) { processing.resetOverlay(); overlay.show(processing.overlay, function(event) makeLauncherRequest(function(result) { @@ -122,7 +122,7 @@ // Hide overlay overlay.hide(0, function() { - if(cliParams.autoLogin) { + if (cliParams.autoLogin) { goAuth(null); } }); @@ -139,15 +139,15 @@ function doUpdate(profile, pp, accessToken) { update.resetOverlay("Обновление файлов JVM"); overlay.swap(0, update.overlay, function(event) { - var jvmDir = updatesDir.resolve(jvmDirName); + var jvmDir = settings.updatesDir.resolve(jvmDirName); makeUpdateRequest(jvmDirName, jvmDir, null, function(jvmHDir) { update.resetOverlay("Обновление файлов ресурсов"); var assetDirName = profile.object.block.getEntryValue("assetDir", StringConfigEntryClass); - var assetDir = updatesDir.resolve(assetDirName); + var assetDir = settings.updatesDir.resolve(assetDirName); makeUpdateRequest(assetDirName, assetDir, null, function(assetHDir) { update.resetOverlay("Обновление файлов клиента"); var clientDirName = profile.object.block.getEntryValue("dir", StringConfigEntryClass); - var clientDir = updatesDir.resolve(clientDirName); + var clientDir = settings.updatesDir.resolve(clientDirName); makeUpdateRequest(clientDirName, clientDir, profile.object.getUpdateMatcher(), function(clientHDir) doLaunchClient(jvmDir, jvmHDir, clientHDir, assetDir, clientDir, profile, pp, accessToken) ); @@ -165,7 +165,7 @@ } function doDebugClient(process) { - if(!LogHelper.isDebugEnabled()) { + if (!LogHelper.isDebugEnabled()) { javafx.application.Platform.exit(); return; } @@ -175,11 +175,11 @@ overlay.swap(0, debug.overlay, function(event) debugProcess(process)); } -/* ======== Server handler functions ======== */ +/* ======== Server handler functions ======== */ function updateProfilesList() { // Set profiles items profilesBox.setItems(javafx.collections.FXCollections.observableList(profiles)); - for each(var profile in profiles) { + for each (var profile in profiles) { pingers[profile.object] = new ServerPinger(profile.object.getServerSocketAddress(), profile.object.getVersion()); } @@ -206,7 +206,7 @@ updateItem: function(item, empty) { Java.super(cell).updateItem(item, empty); cell.setGraphic(empty ? null : statusBox); - if(empty) { // No need to update state + if (empty) { // No need to update state return; } @@ -239,7 +239,7 @@ /* ======== Overlay helper functions ======== */ function fade(region, delay, from, to, onFinished) { var transition = new javafx.animation.FadeTransition(javafx.util.Duration.millis(100), region); - if(onFinished !== null) { + if (onFinished !== null) { transition.setOnFinished(onFinished); } @@ -290,7 +290,7 @@ // Reset overlay state overlay.current = null; - if(onFinished !== null) { + if (onFinished !== null) { onFinished(); } }); diff --git a/Launcher/runtime/dialog/overlay/debug/debug.js b/Launcher/runtime/dialog/overlay/debug/debug.js index a9d386d..bebabce 100755 --- a/Launcher/runtime/dialog/overlay/debug/debug.js +++ b/Launcher/runtime/dialog/overlay/debug/debug.js @@ -23,7 +23,7 @@ debug.action = debug.overlay.lookup("#action"); debug.action.setOnAction(function(event) { var process = debug.process; - if(process !== null && process.isAlive()) { + if (process !== null && process.isAlive()) { process.destroyForcibly(); debug.updateActionButton(true); return; @@ -74,7 +74,7 @@ java.nio.charset.Charset.defaultCharset()); var appendFunction = function(line) javafx.application.Platform.runLater(function() debug.append(line)); - for(var length = reader.read(buffer); length >= 0; length = reader.read(buffer)) { + for (var length = reader.read(buffer); length >= 0; length = reader.read(buffer)) { appendFunction(new java.lang.String(buffer, 0, length)); } diff --git a/Launcher/runtime/dialog/overlay/processing/processing.js b/Launcher/runtime/dialog/overlay/processing/processing.js index 1d02f9a..48bdd1b 100755 --- a/Launcher/runtime/dialog/overlay/processing/processing.js +++ b/Launcher/runtime/dialog/overlay/processing/processing.js @@ -35,13 +35,13 @@ task.setOnFailed(function(event) { processing.description.textProperty().unbind(); processing.setError(task.getException()); - if(hide) { + if (hide) { overlay.hide(2500, null); } }); task.setOnSucceeded(function(event) { processing.description.textProperty().unbind(); - if(callback !== null) { + if (callback !== null) { callback(task.getValue()); } }); diff --git a/Launcher/runtime/dialog/overlay/settings/settings.fxml b/Launcher/runtime/dialog/overlay/settings/settings.fxml index c4c4066..5342feb 100755 --- a/Launcher/runtime/dialog/overlay/settings/settings.fxml +++ b/Launcher/runtime/dialog/overlay/settings/settings.fxml @@ -3,6 +3,7 @@ + @@ -24,17 +25,17 @@ Выделение памяти: - ... + - + Директория загрузок: - ... + -