diff --git a/Launcher/runtime/dialog/dialog.js b/Launcher/runtime/dialog/dialog.js index acd7ba4b..16ce9d2f 100644 --- a/Launcher/runtime/dialog/dialog.js +++ b/Launcher/runtime/dialog/dialog.js @@ -298,6 +298,16 @@ function doAuth(login, rsaPassword, auth_type) { }) }); } +function goOAuth(event) { + processing.resetOverlay(); + overlay.show(processing.overlay, function (event) { + FunctionalBridge.getHWID.join(); + makeOAuthRequest(function (result) { + openURL(result); + return result; + }) + }); +} function doUpdate(profile, pp, accessToken) { var digest = profile.isUpdateFastCheck(); diff --git a/Launcher/runtime/dialog/images/icons/vk.png b/Launcher/runtime/dialog/images/icons/vk.png new file mode 100644 index 00000000..7e422eab Binary files /dev/null and b/Launcher/runtime/dialog/images/icons/vk.png differ diff --git a/Launcher/runtime/dialog/overlay/processing/processing.js b/Launcher/runtime/dialog/overlay/processing/processing.js index cfff7bc6..282340cf 100644 --- a/Launcher/runtime/dialog/overlay/processing/processing.js +++ b/Launcher/runtime/dialog/overlay/processing/processing.js @@ -121,6 +121,12 @@ function makeAuthRequest(login, rsaPassword, auth_type, callback) { task.updateMessage("Авторизация на сервере"); startTask(task); } +function makeOAuthRequest(callback) { + newRequestTask(new OAuthRequest(FunctionalBridge.getHWID())); + processing.setTaskProperties(task, callback, null, true); + task.updateMessage("Ожидание авторизации"); + startTask(task); +} function launchClient(assetHDir, clientHDir, profile, params, callback) { var task = newTask(function() ClientLauncher.launch(assetHDir, clientHDir, diff --git a/Launcher/runtime/dialog/scenes/login/login.fxml b/Launcher/runtime/dialog/scenes/login/login.fxml index a2db6ff7..a4c6bd39 100644 --- a/Launcher/runtime/dialog/scenes/login/login.fxml +++ b/Launcher/runtime/dialog/scenes/login/login.fxml @@ -24,7 +24,8 @@ - + + diff --git a/Launcher/runtime/dialog/styles.css b/Launcher/runtime/dialog/styles.css index d26cc8e4..3aa2b423 100644 --- a/Launcher/runtime/dialog/styles.css +++ b/Launcher/runtime/dialog/styles.css @@ -121,12 +121,23 @@ .auth { -fx-background-radius: 0; -fx-background-color: #5fd97a; -fx-text-fill: #ffffff; - -fx-pref-width: 200px; + -fx-pref-width: 145px; -fx-pref-height: 45px; -fx-effect: dropshadow(gaussian, rgba(23, 25, 29, 0.3), 15,0,0,3); } +.vkauth { + -jfx-button-type: FLAT; + -fx-background-radius: 0; + -fx-font-size: 0pt; + -fx-background-image: url('images/icons/vk.png'); + -fx-background-repeat: no-repeat; + -fx-pref-width: 55px; + -fx-pref-height: 55px; + -fx-effect: dropshadow(gaussian, rgba(23, 25, 29, 0.3), 15,0,0,3); +} .auth:hover, .auth:pressed { -fx-background-color: #75e18c; } +.vkauth:hover, .vkauth:pressed { -fx-background-color: #75e18c; } #password, #login { -fx-background-radius: 0; diff --git a/Launcher/runtime/engine/api.js b/Launcher/runtime/engine/api.js index 0b07d4fb..8a8c393a 100644 --- a/Launcher/runtime/engine/api.js +++ b/Launcher/runtime/engine/api.js @@ -19,6 +19,7 @@ var RequestType = RequestTypeClass.static; var RequestException = RequestExceptionClass.static; //var PingRequest = PingRequestClass.static; var AuthRequest = AuthRequestClass.static; +var OAuthRequest = OAuthRequestClass.static; var JoinServerRequest = JoinServerRequestClass.static; var CheckServerRequest = CheckServerRequestClass.static; var UpdateRequest = UpdateRequestClass.static;