Новый дизайн с раздельной авторизацией от DrLeonardo
|
@ -1,13 +1,15 @@
|
||||||
// ====== LAUNCHER CONFIG ====== //
|
// ====== LAUNCHER CONFIG ====== //
|
||||||
var config = {
|
var config = {
|
||||||
dir: "gravitlauncher", // Launcher directory
|
dir: "GravitLauncher", // Launcher directory
|
||||||
title: "Gravit Minecraft Launcher", // Window title
|
title: "GravitLauncher", // Window title
|
||||||
icons: [ "favicon.png" ], // Window icon paths
|
icons: [ "favicon.png" ], // Window icon paths
|
||||||
|
|
||||||
// Auth config
|
// Auth config
|
||||||
newsURL: "https://github.com/GravitLauncher/Launcher/releases", // News WebView URL
|
linkText: "GravitHome site", // Text for link under "Auth" button
|
||||||
linkText: "GravitLauncher GitHub", // Text for link under "Auth" button
|
linkURL: new java.net.URL("https://gravithome.ru/"), // URL for link under "Auth" button
|
||||||
linkURL: new java.net.URL("https://github.com/GravitLauncher/Launcher"), // URL for link under "Auth" button
|
|
||||||
|
// Menu config
|
||||||
|
discord_url: new java.net.URL("https://discord.gg/bf7ZtwC"),
|
||||||
|
|
||||||
// Settings defaults
|
// Settings defaults
|
||||||
settingsMagic: 0xC0DE5, // Ancient magic, don't touch
|
settingsMagic: 0xC0DE5, // Ancient magic, don't touch
|
||||||
|
|
|
@ -1,41 +0,0 @@
|
||||||
@import url(styles/common.css);
|
|
||||||
|
|
||||||
/* Header styles */
|
|
||||||
#layout {
|
|
||||||
-fx-background-color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Auth pane styles */
|
|
||||||
#layout > #authPane > #password.hasSaved {
|
|
||||||
-fx-prompt-text-fill: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
#layout > #authPane > #profiles > .arrow-button {
|
|
||||||
-fx-padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#layout > #authPane > #profiles > .arrow-button > .arrow {
|
|
||||||
-fx-padding: 0;
|
|
||||||
-fx-shape: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#layout > #authPane > #profiles > .list-cell {
|
|
||||||
-fx-padding: 5px 5px 5px 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#layout > #authPane > #goSettings {
|
|
||||||
-fx-padding: 0;
|
|
||||||
-fx-graphic: url(settings.png);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Overlay styles */
|
|
||||||
#layout > #dim {
|
|
||||||
-fx-opacity: 0.0;
|
|
||||||
-fx-background-color: rgba(0, 0, 0, 0.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
#layout > #dim > #overlay {
|
|
||||||
-fx-opacity: 0.0;
|
|
||||||
-fx-background-color: white;
|
|
||||||
-fx-background-radius: 5px;
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<?import java.net.URL?>
|
|
||||||
<?import javafx.scene.control.Button?>
|
|
||||||
<?import javafx.scene.control.CheckBox?>
|
|
||||||
<?import javafx.scene.control.ComboBox?>
|
|
||||||
<?import javafx.scene.control.Hyperlink?>
|
|
||||||
<?import javafx.scene.control.PasswordField?>
|
|
||||||
<?import javafx.scene.control.TextField?>
|
|
||||||
<?import javafx.scene.layout.Pane?>
|
|
||||||
<?import javafx.scene.web.WebView?>
|
|
||||||
|
|
||||||
<Pane xmlns:fx="http://javafx.com/fxml/1" fx:id="layout" prefWidth="600.0" prefHeight="400.0">
|
|
||||||
<stylesheets>
|
|
||||||
<URL value="@dialog.css" />
|
|
||||||
</stylesheets>
|
|
||||||
|
|
||||||
<!-- News web view -->
|
|
||||||
<WebView fx:id="news" layoutX="0.0" layoutY="0.0" prefWidth="600.0" prefHeight="315.0" />
|
|
||||||
|
|
||||||
<!-- Auth pane -->
|
|
||||||
<Pane fx:id="authPane" layoutX="0.0" layoutY="315.0" prefWidth="600.0" prefHeight="85.0">
|
|
||||||
<!-- First row -->
|
|
||||||
<TextField fx:id="login" layoutX="10.0" layoutY="10.0" prefWidth="200.0" prefHeight="30.0" promptText="Логин" />
|
|
||||||
<PasswordField fx:id="password" layoutX="215.0" layoutY="10.0" prefWidth="200.0" prefHeight="30.0" promptText="Пароль" />
|
|
||||||
<Button fx:id="goAuth" layoutX="430.0" layoutY="10.0" prefWidth="125.0" prefHeight="30.0" text="Авторизация" defaultButton="true" />
|
|
||||||
<Button fx:id="goSettings" layoutX="560.0" layoutY="10.0" prefWidth="30.0" prefHeight="30.0" />
|
|
||||||
|
|
||||||
<!-- Second row -->
|
|
||||||
<ComboBox fx:id="profiles" layoutX="10.0" layoutY="45.0" prefWidth="200.0" prefHeight="30.0" />
|
|
||||||
<CheckBox fx:id="savePassword" layoutX="220.0" layoutY="50.0" prefWidth="200.0" text="Сохранить пароль" />
|
|
||||||
<Hyperlink fx:id="link" layoutX="430.0" layoutY="45.0" prefWidth="160.0" prefHeight="30.0" />
|
|
||||||
</Pane>
|
|
||||||
|
|
||||||
<!-- Overlay -->
|
|
||||||
<Pane fx:id="dim" layoutX="0.0" layoutY="0.0" prefWidth="600.0" prefHeight="400.0" visible="false" />
|
|
||||||
</Pane>
|
|
|
@ -1,37 +1,57 @@
|
||||||
// Dialog nodes
|
// Ининциализируем кучу всяких переменных
|
||||||
var rootPane, news, authPane, dimPane;
|
var authPane, dimPane, serverPane;
|
||||||
var loginField, passwordField, savePasswordBox, profilesBox;
|
|
||||||
var movePoint = null; // Point2D
|
|
||||||
|
|
||||||
// State variables
|
// Переменные от окна входа
|
||||||
var pingers = {};
|
var loginField, passwordField, forgotButton, savePasswordBox, registerButton;
|
||||||
|
|
||||||
function initDialog() {
|
// Переменные от основной менюшки
|
||||||
// Lookup news WebView
|
var serverList, serverInfo, serverDescription, serverEntrance, serverLabel, serverStatus;
|
||||||
news = rootPane.lookup("#news");
|
var discord_url;
|
||||||
var newsEngine = news.getEngine();
|
|
||||||
newsEngine.setUserDataDirectory(DirBridge.dir.resolve("webview").toFile());
|
|
||||||
newsEngine.load(config.newsURL);
|
|
||||||
|
|
||||||
// Lookup auth pane and dim
|
// Прочие вспомогалки
|
||||||
initAuthPane(rootPane.lookup("#authPane"));
|
var profilesList = []; // Ассоциативный массив: "кнопка сервера" => "профиль сервера"
|
||||||
dimPane = rootPane.lookup("#dim");
|
var movePoint = null; // Координата, хранящая опроную точку при Drag'е
|
||||||
|
var pingers = {}; // ддосеры серверов
|
||||||
|
var loginData; // Буфер для данных авторизации
|
||||||
|
|
||||||
// Init overlays
|
function initLauncher() {
|
||||||
|
|
||||||
|
// Инициализируем основы
|
||||||
|
initLoginScene();
|
||||||
|
initMenuScene();
|
||||||
|
|
||||||
|
// Инициализируем доп. менюшки
|
||||||
debug.initOverlay();
|
debug.initOverlay();
|
||||||
processing.initOverlay();
|
processing.initOverlay();
|
||||||
settingsOverlay.initOverlay();
|
settingsOverlay.initOverlay();
|
||||||
update.initOverlay();
|
update.initOverlay();
|
||||||
|
options.initOverlay();
|
||||||
|
|
||||||
// Verify launcher & make request
|
// Делаем запрос на проверку свежести лаунчера, ну и сервера заодно обновляем
|
||||||
verifyLauncher();
|
verifyLauncher();
|
||||||
}
|
}
|
||||||
|
|
||||||
function initAuthPane(pane) {
|
function initLoginScene() {
|
||||||
|
loginPane.setOnMousePressed(function(event){ movePoint = new javafx.geometry.Point2D(event.getSceneX(), event.getSceneY())});
|
||||||
|
loginPane.setOnMouseDragged(function(event) {
|
||||||
|
if(movePoint === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Обновляем позицию панели
|
||||||
|
stage.setX(event.getScreenX() - movePoint.getX());
|
||||||
|
stage.setY(event.getScreenY() - movePoint.getY());
|
||||||
|
});
|
||||||
|
loginPane.lookup("#exitbtn").setOnAction(function(event){ javafx.application.Platform.exit()});
|
||||||
|
loginPane.lookup("#hidebtn").setOnAction(function(event){ stage.setIconified(true)});
|
||||||
|
loginPane.lookup("#discord_url").setOnAction(function(){ openURL(config.discord_url); });
|
||||||
|
|
||||||
|
var pane = loginPane.lookup("#authPane");
|
||||||
authPane = pane;
|
authPane = pane;
|
||||||
|
|
||||||
// Lookup login field
|
// Lookup login field
|
||||||
loginField = pane.lookup("#login");
|
loginField = pane.lookup("#login");
|
||||||
|
loginField.setOnMouseMoved(function(event){rootPane.fireEvent(event)});
|
||||||
loginField.setOnAction(goAuth);
|
loginField.setOnAction(goAuth);
|
||||||
if (settings.login !== null) {
|
if (settings.login !== null) {
|
||||||
loginField.setText(settings.login);
|
loginField.setText(settings.login);
|
||||||
|
@ -39,19 +59,15 @@ function initAuthPane(pane) {
|
||||||
|
|
||||||
// Lookup password field
|
// Lookup password field
|
||||||
passwordField = pane.lookup("#password");
|
passwordField = pane.lookup("#password");
|
||||||
|
passwordField.setOnMouseMoved(function(event){rootPane.fireEvent(event)});
|
||||||
passwordField.setOnAction(goAuth);
|
passwordField.setOnAction(goAuth);
|
||||||
if (settings.rsaPassword !== null) {
|
if (settings.rsaPassword !== null) {
|
||||||
passwordField.getStyleClass().add("hasSaved");
|
passwordField.getStyleClass().add("hasSaved");
|
||||||
passwordField.setPromptText("*** Сохранённый ***");
|
passwordField.setPromptText("*** Сохранённый ***");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lookup profiles combobox
|
|
||||||
profilesBox = pane.lookup("#profiles");
|
|
||||||
profilesBox.setCellFactory(newProfileCell);
|
|
||||||
profilesBox.setButtonCell(newProfileCell(null));
|
|
||||||
|
|
||||||
// Lookup save password box
|
// Lookup save password box
|
||||||
savePasswordBox = pane.lookup("#savePassword");
|
savePasswordBox = pane.lookup("#rememberchb");
|
||||||
savePasswordBox.setSelected(settings.login === null || settings.rsaPassword !== null);
|
savePasswordBox.setSelected(settings.login === null || settings.rsaPassword !== null);
|
||||||
|
|
||||||
// Lookup hyperlink text and actions
|
// Lookup hyperlink text and actions
|
||||||
|
@ -61,11 +77,46 @@ function initAuthPane(pane) {
|
||||||
|
|
||||||
// Lookup action buttons
|
// Lookup action buttons
|
||||||
pane.lookup("#goAuth").setOnAction(goAuth);
|
pane.lookup("#goAuth").setOnAction(goAuth);
|
||||||
pane.lookup("#goSettings").setOnAction(goSettings);
|
}
|
||||||
|
|
||||||
|
function initMenuScene() {
|
||||||
|
menuPane.setOnMousePressed(function(event){ movePoint = new javafx.geometry.Point2D(event.getSceneX(), event.getSceneY())});
|
||||||
|
menuPane.setOnMouseDragged(function(event) {
|
||||||
|
if(movePoint === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Обновляем позицию панели
|
||||||
|
stage.setX(event.getScreenX() - movePoint.getX());
|
||||||
|
stage.setY(event.getScreenY() - movePoint.getY());
|
||||||
|
});
|
||||||
|
menuPane.lookup("#exitbtn").setOnAction(function(event){ javafx.application.Platform.exit()});
|
||||||
|
menuPane.lookup("#hidebtn").setOnAction(function(event){ stage.setIconified(true)});
|
||||||
|
var pane = menuPane.lookup("#serverPane");
|
||||||
|
serverPane = pane;
|
||||||
|
|
||||||
|
menuPane.lookup("#discord_url").setOnAction(function(){ openURL(config.discord_url); });
|
||||||
|
|
||||||
|
pane.lookup("#settingsbtn").setOnAction(goSettings);
|
||||||
|
pane.lookup("#clientbtn").setOnAction(goOptions);
|
||||||
|
serverList = pane.lookup("#serverlist").getContent();
|
||||||
|
serverInfo = pane.lookup("#serverinfo").getContent();
|
||||||
|
serverDescription = serverInfo.lookup("#serverDescription");
|
||||||
|
|
||||||
|
serverEntrance = pane.lookup("#serverentrance");
|
||||||
|
serverStatus = serverEntrance.lookup("#serverStatus");
|
||||||
|
serverLabel = serverEntrance.lookup("#serverLabel");
|
||||||
|
serverEntrance.lookup("#serverLaunch").setOnAction(function(){
|
||||||
|
doUpdate(profilesList[serverHolder.old], loginData.pp, loginData.accessToken);
|
||||||
|
});
|
||||||
|
|
||||||
|
pane.lookup("#logoutbtn").setOnAction(function(){
|
||||||
|
setCurrentScene(loginScene);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function initOffline() {
|
function initOffline() {
|
||||||
// Update title
|
// Меняем заголовок(Хер его знает зачем, его всё равно нигде не видно...
|
||||||
stage.setTitle(config.title + " [Offline]");
|
stage.setTitle(config.title + " [Offline]");
|
||||||
|
|
||||||
// Set login field as username field
|
// Set login field as username field
|
||||||
|
@ -74,14 +125,11 @@ function initOffline() {
|
||||||
loginField.setText(""); // Reset if not valid
|
loginField.setText(""); // Reset if not valid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Disable password field
|
// Disable password field
|
||||||
passwordField.setDisable(true);
|
passwordField.setDisable(true);
|
||||||
passwordField.setPromptText("Недоступно");
|
passwordField.setPromptText("Недоступно");
|
||||||
passwordField.setText("");
|
passwordField.setText("");
|
||||||
|
|
||||||
// Switch news view to offline page
|
|
||||||
var offlineURL = Launcher.getResourceURL("dialog/offline/offline.html");
|
|
||||||
news.getEngine().load(offlineURL.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ======== Handler functions ======== */
|
/* ======== Handler functions ======== */
|
||||||
|
@ -91,16 +139,6 @@ function goAuth(event) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get profile
|
|
||||||
var profile = profilesBox.getSelectionModel().getSelectedItem();
|
|
||||||
if (profile === null) {
|
|
||||||
return; // No profile selected
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ClientLauncher.setProfile(profile.object);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get login
|
// Get login
|
||||||
var login = loginField.getText();
|
var login = loginField.getText();
|
||||||
if (login.isEmpty()) {
|
if (login.isEmpty()) {
|
||||||
|
@ -116,16 +154,15 @@ function goAuth(event) {
|
||||||
} else if (settings.rsaPassword !== null) {
|
} else if (settings.rsaPassword !== null) {
|
||||||
rsaPassword = settings.rsaPassword;
|
rsaPassword = settings.rsaPassword;
|
||||||
} else {
|
} else {
|
||||||
return; // No password - no auth, sorry :C
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remember or reset password
|
|
||||||
settings.rsaPassword = savePasswordBox.isSelected() ? rsaPassword : null;
|
settings.rsaPassword = savePasswordBox.isSelected() ? rsaPassword : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show auth overlay
|
// Show auth overlay
|
||||||
settings.login = login;
|
settings.login = login;
|
||||||
doAuth(profile, login, rsaPassword);
|
doAuth(login, rsaPassword);
|
||||||
}
|
}
|
||||||
|
|
||||||
function goSettings(event) {
|
function goSettings(event) {
|
||||||
|
@ -138,6 +175,16 @@ function goSettings(event) {
|
||||||
overlay.show(settingsOverlay.overlay, null);
|
overlay.show(settingsOverlay.overlay, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function goOptions(event) {
|
||||||
|
// Verify there's no other overlays
|
||||||
|
if (overlay.current !== null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show options overlay
|
||||||
|
overlay.show(options.overlay, null);
|
||||||
|
}
|
||||||
|
|
||||||
/* ======== Processing functions ======== */
|
/* ======== Processing functions ======== */
|
||||||
function verifyLauncher(e) {
|
function verifyLauncher(e) {
|
||||||
processing.resetOverlay();
|
processing.resetOverlay();
|
||||||
|
@ -163,22 +210,31 @@ function verifyLauncher(e) {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
function doAuth(profile, login, rsaPassword) {
|
function doAuth(login, rsaPassword) {
|
||||||
processing.resetOverlay();
|
processing.resetOverlay();
|
||||||
overlay.show(processing.overlay, function(event) makeAuthRequest(login, rsaPassword, function(result)
|
overlay.show(processing.overlay, function (event) {
|
||||||
doUpdate(profile, result.pp, result.accessToken)
|
makeAuthRequest(login, rsaPassword, function (result) {
|
||||||
));
|
loginData = { pp: result.pp , accessToken: result.accessToken};
|
||||||
|
|
||||||
|
overlay.hide(0, function () {
|
||||||
|
setCurrentScene(menuScene);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function doUpdate(profile, pp, accessToken) {
|
function doUpdate(profile, pp, accessToken) {
|
||||||
var digest = profile.object.isUpdateFastCheck();
|
var digest = profile.object.isUpdateFastCheck();
|
||||||
|
overlay.swap(0, update.overlay, function(event) {
|
||||||
|
|
||||||
// Update asset dir
|
// Update asset dir
|
||||||
overlay.swap(0, update.overlay, function(event) {
|
|
||||||
update.resetOverlay("Обновление файлов ресурсов");
|
update.resetOverlay("Обновление файлов ресурсов");
|
||||||
var assetDirName = profile.object.block.getEntryValue("assetDir", StringConfigEntryClass);
|
var assetDirName = profile.object.block.getEntryValue("assetDir", StringConfigEntryClass);
|
||||||
var assetDir = settings.updatesDir.resolve(assetDirName);
|
var assetDir = settings.updatesDir.resolve(assetDirName);
|
||||||
var assetMatcher = profile.object.getAssetUpdateMatcher();
|
var assetMatcher = profile.object.getAssetUpdateMatcher();
|
||||||
|
makeSetProfileRequest(profile.object, function() {
|
||||||
|
ClientLauncher.setProfile(profile.object);
|
||||||
makeUpdateRequest(assetDirName, assetDir, assetMatcher, digest, function(assetHDir) {
|
makeUpdateRequest(assetDirName, assetDir, assetMatcher, digest, function(assetHDir) {
|
||||||
settings.lastHDirs.put(assetDirName, assetHDir);
|
settings.lastHDirs.put(assetDirName, assetHDir);
|
||||||
|
|
||||||
|
@ -193,6 +249,7 @@ function doUpdate(profile, pp, accessToken) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function doLaunchClient(assetDir, assetHDir, clientDir, clientHDir, profile, pp, accessToken) {
|
function doLaunchClient(assetDir, assetHDir, clientDir, clientHDir, profile, pp, accessToken) {
|
||||||
|
@ -216,63 +273,40 @@ function doDebugClient(process) {
|
||||||
|
|
||||||
/* ======== Server handler functions ======== */
|
/* ======== Server handler functions ======== */
|
||||||
function updateProfilesList(profiles) {
|
function updateProfilesList(profiles) {
|
||||||
|
profilesList = [];
|
||||||
// Set profiles items
|
// Set profiles items
|
||||||
profilesBox.setItems(javafx.collections.FXCollections.observableList(profiles));
|
serverList.getChildren().clear();
|
||||||
for each (var profile in profiles) {
|
profiles.forEach(function (profile, i, arr) {
|
||||||
pingers[profile.object] = new ServerPinger(profile.object.getServerSocketAddress(), profile.object.getVersion());
|
pingers[profile.object] = new ServerPinger(profile.object.getServerSocketAddress(), profile.object.getVersion());
|
||||||
|
var serverBtn = new javafx.scene.control.ToggleButton(profile);
|
||||||
|
(function () {
|
||||||
|
profilesList[serverBtn] = profile;
|
||||||
|
var hold = serverBtn;
|
||||||
|
serverBtn.setOnAction(function (event) {
|
||||||
|
serverHolder.set(hold);
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
serverList.getChildren().add(serverBtn);
|
||||||
|
});
|
||||||
|
serverHolder.set(serverList.getChildren().get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set profiles selection model
|
function pingServer(btn) {
|
||||||
var sm = profilesBox.getSelectionModel();
|
var profile = profilesList[btn];
|
||||||
sm.selectedIndexProperty()["addListener(javafx.beans.value.ChangeListener)"](
|
setServerStatus("...");
|
||||||
function(o, ov, nv) settings.profile = nv); // Store selected profile index
|
|
||||||
|
|
||||||
// Restore selected item
|
|
||||||
var i = settings.profile;
|
|
||||||
sm.select(i < profiles.size() ? i : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
function newProfileCell(listView) {
|
|
||||||
var statusBox = loadFXML("dialog/profileCell.fxml");
|
|
||||||
|
|
||||||
// Lookup labels
|
|
||||||
var title = statusBox.lookup("#profileTitle");
|
|
||||||
var status = statusBox.lookup("#serverStatus");
|
|
||||||
var statusCircle = title.getGraphic();
|
|
||||||
|
|
||||||
// Create and return new cell
|
|
||||||
var cell = new (Java.extend(javafx.scene.control.ListCell))() {
|
|
||||||
updateItem: function(item, empty) {
|
|
||||||
Java.super(cell).updateItem(item, empty);
|
|
||||||
cell.setGraphic(empty ? null : statusBox);
|
|
||||||
if (empty) { // No need to update state
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update title and server status
|
|
||||||
title.setText(item.object.getTitle());
|
|
||||||
pingServer(status, statusCircle, item);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
cell.setText(null);
|
|
||||||
return cell;
|
|
||||||
}
|
|
||||||
|
|
||||||
function pingServer(status, statusCircle, profile) {
|
|
||||||
setServerStatus(status, statusCircle, javafx.scene.paint.Color.GREY, "...");
|
|
||||||
var task = newTask(function() pingers[profile.object].ping());
|
var task = newTask(function() pingers[profile.object].ping());
|
||||||
task.setOnSucceeded(function(event) {
|
task.setOnSucceeded(function(event) {
|
||||||
var result = task.getValue();
|
var result = task.getValue();
|
||||||
var color = result.isOverfilled() ? javafx.scene.paint.Color.YELLOW : javafx.scene.paint.Color.GREEN;
|
if(btn==serverHolder.old){
|
||||||
setServerStatus(status, statusCircle, color, java.lang.String.format("%d из %d", result.onlinePlayers, result.maxPlayers));
|
setServerStatus(java.lang.String.format("%d из %d", result.onlinePlayers, result.maxPlayers));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
task.setOnFailed(function(event) setServerStatus(status, statusCircle, javafx.scene.paint.Color.RED, "Недоступен"));
|
task.setOnFailed(function(event){ if(btn==serverHolder.old){setServerStatus("Недоступен")}});
|
||||||
startTask(task);
|
startTask(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setServerStatus(status, statusCircle, color, description) {
|
function setServerStatus(description) {
|
||||||
status.setText(description);
|
serverStatus.setText(description);
|
||||||
statusCircle.setFill(color);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ======== Overlay helper functions ======== */
|
/* ======== Overlay helper functions ======== */
|
||||||
|
@ -294,7 +328,6 @@ var overlay = {
|
||||||
|
|
||||||
show: function(newOverlay, onFinished) {
|
show: function(newOverlay, onFinished) {
|
||||||
// Freeze root pane
|
// Freeze root pane
|
||||||
news.setDisable(true);
|
|
||||||
authPane.setDisable(true);
|
authPane.setDisable(true);
|
||||||
overlay.current = newOverlay;
|
overlay.current = newOverlay;
|
||||||
|
|
||||||
|
@ -323,7 +356,6 @@ var overlay = {
|
||||||
dimPane.setVisible(false);
|
dimPane.setVisible(false);
|
||||||
|
|
||||||
// Unfreeze root pane
|
// Unfreeze root pane
|
||||||
news.setDisable(false);
|
|
||||||
authPane.setDisable(false);
|
authPane.setDisable(false);
|
||||||
rootPane.requestFocus();
|
rootPane.requestFocus();
|
||||||
|
|
||||||
|
@ -341,6 +373,11 @@ var overlay = {
|
||||||
fade(overlay.current, delay, 1.0, 0.0, function(event) {
|
fade(overlay.current, delay, 1.0, 0.0, function(event) {
|
||||||
dimPane.requestFocus();
|
dimPane.requestFocus();
|
||||||
|
|
||||||
|
|
||||||
|
if(overlay.current==null){
|
||||||
|
overlay.show(newOverlay, onFinished);
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Hide old overlay
|
// Hide old overlay
|
||||||
if (overlay.current !== newOverlay) {
|
if (overlay.current !== newOverlay) {
|
||||||
var child = dimPane.getChildren();
|
var child = dimPane.getChildren();
|
||||||
|
@ -358,8 +395,27 @@ var overlay = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var serverHolder = {
|
||||||
|
old: null,
|
||||||
|
|
||||||
|
set: function(btn){
|
||||||
|
pingServer(btn);
|
||||||
|
serverLabel.setText("СЕРВЕР " + profilesList[btn]);
|
||||||
|
serverDescription.setText(serversConfig.getServerProperty(profilesList[btn], "description"));
|
||||||
|
btn.setSelected(true);
|
||||||
|
btn.setDisable(true);
|
||||||
|
if(serverHolder.old!=null){
|
||||||
|
serverHolder.old.setSelected(false);
|
||||||
|
serverHolder.old.setDisable(false);
|
||||||
|
}
|
||||||
|
serverHolder.old = btn;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/* ======== Overlay scripts ======== */
|
/* ======== Overlay scripts ======== */
|
||||||
launcher.loadScript("dialog/overlay/debug/debug.js");
|
launcher.loadScript("dialog/overlay/debug/debug.js");
|
||||||
launcher.loadScript("dialog/overlay/processing/processing.js");
|
launcher.loadScript("dialog/overlay/processing/processing.js");
|
||||||
launcher.loadScript("dialog/overlay/settings/settings.js");
|
launcher.loadScript("dialog/overlay/settings/settings.js");
|
||||||
|
launcher.loadScript("dialog/overlay/options/options.js");
|
||||||
launcher.loadScript("dialog/overlay/update/update.js");
|
launcher.loadScript("dialog/overlay/update/update.js");
|
||||||
|
|
||||||
|
|
BIN
Launcher/runtime/dialog/images/background.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
Launcher/runtime/dialog/images/downloader/background.png
Normal file
After Width: | Height: | Size: 106 KiB |
BIN
Launcher/runtime/dialog/images/downloader/cl_line.png
Normal file
After Width: | Height: | Size: 433 B |
BIN
Launcher/runtime/dialog/images/icons/checkbox.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
Launcher/runtime/dialog/images/icons/checkbox_checked.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
Launcher/runtime/dialog/images/icons/close.png
Normal file
After Width: | Height: | Size: 663 B |
BIN
Launcher/runtime/dialog/images/icons/discord.png
Normal file
After Width: | Height: | Size: 626 B |
BIN
Launcher/runtime/dialog/images/icons/forum.png
Normal file
After Width: | Height: | Size: 547 B |
BIN
Launcher/runtime/dialog/images/icons/help.png
Normal file
After Width: | Height: | Size: 423 B |
BIN
Launcher/runtime/dialog/images/icons/hide.png
Normal file
After Width: | Height: | Size: 586 B |
BIN
Launcher/runtime/dialog/images/icons/loading.gif
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
Launcher/runtime/dialog/images/icons/options.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
Launcher/runtime/dialog/images/icons/server.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Launcher/runtime/dialog/images/icons/server_hover.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Launcher/runtime/dialog/images/icons/settings.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Launcher/runtime/dialog/images/icons/store.png
Normal file
After Width: | Height: | Size: 361 B |
BIN
Launcher/runtime/dialog/images/icons/vk.png
Normal file
After Width: | Height: | Size: 407 B |
BIN
Launcher/runtime/dialog/images/mainmenu/background.png
Normal file
After Width: | Height: | Size: 118 KiB |
123
Launcher/runtime/dialog/login.css
Normal file
|
@ -0,0 +1,123 @@
|
||||||
|
Button, CheckBox, ComboBox, RadioButton {
|
||||||
|
-fx-cursor: hand;
|
||||||
|
}
|
||||||
|
|
||||||
|
#layout {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
#link {
|
||||||
|
-fx-font-weight: bold;
|
||||||
|
-fx-font-size: 8pt;
|
||||||
|
-fx-opacity: 0.5;
|
||||||
|
-fx-text-fill: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#exitbtn{
|
||||||
|
-fx-background-position: center;
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-opacity: 0.4;
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
-fx-background-image: url('images/icons/close.png');
|
||||||
|
}
|
||||||
|
#hidebtn{
|
||||||
|
-fx-background-position: center;
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-opacity: 0.4;
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
-fx-padding: 10;
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
-fx-background-image: url('images/icons/hide.png');
|
||||||
|
}
|
||||||
|
|
||||||
|
#hidebtn:hover, #hidebtn:pressed, #exitbtn:hover, #exitbtn:pressed, #link:hover, #link:pressed { -fx-opacity: 1; }
|
||||||
|
|
||||||
|
#password, #login {
|
||||||
|
-fx-background-color: rgba(0, 0, 0, 0.08);
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#discord_url{
|
||||||
|
-fx-opacity: 0.8;
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-background-image: url('images/icons/discord.png');
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
#discord_url:hover, #discord_url:pressed { -fx-opacity: 1; }
|
||||||
|
|
||||||
|
#rememberchb{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-font-size: 13;
|
||||||
|
-fx-background-image: url('images/icons/checkbox.png');
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
#rememberchb .mark {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
#rememberchb .box {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
#rememberchb:selected{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-background-image: url('images/icons/checkbox_checked.png');
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
#rememberchb:selected .mark {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
#rememberchb:selected .box {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
-fx-font-weight: bold;
|
||||||
|
-fx-font-size: 13pt;
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
-fx-background-color: #61B373;
|
||||||
|
-fx-text-fill: #ffffff;
|
||||||
|
}
|
||||||
|
.btn:hover, .btn:selected {
|
||||||
|
-fx-background-color: #74C085;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-input{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-focus-color: transparent;
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
-fx-text-fill: #E5E5E5;
|
||||||
|
-fx-prompt-text-fill: #E5E5E5;
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-font-family: "Segoe UI";
|
||||||
|
-fx-font-size: 13px;
|
||||||
|
-fx-font-weight: bold;
|
||||||
|
}
|
||||||
|
.text-input:hover{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
.text-input:focused{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
.text-area .scroll-pane {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
.text-area .scroll-pane .viewport{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
.text-area .scroll-pane .content{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
#errormessage{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-text-alignment: center;
|
||||||
|
-fx-text-fill: #ffd96f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error{
|
||||||
|
-fx-text-fill: #ff5555;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mask{
|
||||||
|
-fx-background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
}
|
39
Launcher/runtime/dialog/login.fxml
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import java.net.URL?>
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
|
<?import javafx.scene.control.CheckBox?>
|
||||||
|
<?import javafx.scene.control.Hyperlink?>
|
||||||
|
<?import javafx.scene.control.PasswordField?>
|
||||||
|
<?import javafx.scene.control.TextField?>
|
||||||
|
<?import javafx.scene.image.Image?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
|
<?import javafx.scene.layout.Pane?>
|
||||||
|
|
||||||
|
<!-- DrLeonardo Design -->
|
||||||
|
|
||||||
|
<Pane fx:id="layout" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" visible="true" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
|
<children>
|
||||||
|
<ImageView id="background" fitHeight="400.0" fitWidth="600.0">
|
||||||
|
<image>
|
||||||
|
<Image preserveRatio="true" smooth="true" url="@images/background.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<Pane id="authPane" layoutX="1.0" layoutY="2.0" prefHeight="400.0" prefWidth="600.0">
|
||||||
|
<children>
|
||||||
|
<TextField id="login" alignment="CENTER" layoutX="175.0" layoutY="144.0" prefHeight="45.0" prefWidth="233.0" promptText="Логин" />
|
||||||
|
<PasswordField id="password" alignment="CENTER" layoutX="175.0" layoutY="197.0" prefHeight="45.0" prefWidth="233.0" promptText="Пароль" />
|
||||||
|
<Button id="goAuth" layoutX="159.0" layoutY="319.0" mnemonicParsing="false" opacity="1.0" prefHeight="45.0" prefWidth="267.0" styleClass="btn" text="ВОЙТИ" visible="true" />
|
||||||
|
<CheckBox id="rememberchb" fx:id="savePassword" contentDisplay="CENTER" layoutX="224.0" layoutY="291.0" prefHeight="17.0" prefWidth="137.0" text="Сохранить пароль" textFill="#dadada" />
|
||||||
|
<Hyperlink id="link" fx:id="link" layoutY="371.0" prefHeight="30.0" prefWidth="158.0" textAlignment="CENTER" />
|
||||||
|
<Button id="discord_url" layoutX="278.0" layoutY="373.0" minHeight="16.0" minWidth="28.0" mnemonicParsing="false" prefHeight="16.0" prefWidth="28.0" text="" />
|
||||||
|
</children>
|
||||||
|
</Pane>
|
||||||
|
<Pane id="mask" opacity="0.0" prefHeight="400.0" prefWidth="600.0" visible="false" />
|
||||||
|
<Button id="hidebtn" focusTraversable="false" layoutX="535.0" layoutY="2.0" minHeight="25.0" minWidth="35.0" prefHeight="25.0" prefWidth="25.0" />
|
||||||
|
<Button id="exitbtn" focusTraversable="false" layoutX="574.0" layoutY="2.0" minHeight="25.0" minWidth="20.0" prefHeight="25.0" prefWidth="20.0" />
|
||||||
|
</children>
|
||||||
|
<stylesheets>
|
||||||
|
<URL value="@login.css" />
|
||||||
|
</stylesheets>
|
||||||
|
</Pane>
|
167
Launcher/runtime/dialog/mainmenu.css
Normal file
|
@ -0,0 +1,167 @@
|
||||||
|
Button, CheckBox, ComboBox, RadioButton {
|
||||||
|
-fx-cursor: hand;
|
||||||
|
}
|
||||||
|
|
||||||
|
#layout{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mask {
|
||||||
|
-fx-background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.heading{
|
||||||
|
-fx-text-fill: #555555;
|
||||||
|
}
|
||||||
|
|
||||||
|
#serverLabel{
|
||||||
|
-fx-text-fill: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#exitbtn{
|
||||||
|
-fx-background-position: center;
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-opacity: 0.4;
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
-fx-background-image: url('images/icons/close.png');
|
||||||
|
}
|
||||||
|
#hidebtn{
|
||||||
|
-fx-background-position: center;
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-opacity: 0.4;
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
-fx-padding: 10;
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
-fx-background-image: url('images/icons/hide.png');
|
||||||
|
}
|
||||||
|
|
||||||
|
#logoutbtn{
|
||||||
|
-fx-background-color: #CE5757;
|
||||||
|
-fx-text-fill: #fff;
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
-fx-prompt-text-fill: #fff;
|
||||||
|
-fx-font-family: "Segoe UI";
|
||||||
|
-fx-font-size: 16px;
|
||||||
|
-fx-font-weight: bold;
|
||||||
|
}
|
||||||
|
#logoutbtn:hover{
|
||||||
|
-fx-background-color: #DB5252;
|
||||||
|
}
|
||||||
|
|
||||||
|
#serverlist{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-padding: 5 10;
|
||||||
|
}
|
||||||
|
#serverlist > .viewport {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
#serverdesc{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-padding: 5 10;
|
||||||
|
}
|
||||||
|
#serverdesc > .viewport {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toggle-button:disabled{
|
||||||
|
-fx-opacity: 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#serverinfo{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
#serverinfo > .viewport {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
#servercontainer{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
#servercontainer .toggle-button{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-pref-width: 161;
|
||||||
|
-fx-pref-height: 50;
|
||||||
|
-fx-background-image: url('images/icons/server.png');
|
||||||
|
-fx-padding: 0 0 0 40;
|
||||||
|
-fx-opacity: 0.8;
|
||||||
|
-fx-alignment: CENTER-LEFT;
|
||||||
|
-fx-text-fill: #fff;
|
||||||
|
-fx-translate-y: -1px;
|
||||||
|
-fx-font-family: "Segoe UI";
|
||||||
|
-fx-font-size: 16px;
|
||||||
|
-fx-font-weight: bold;
|
||||||
|
}
|
||||||
|
#servercontainer .toggle-button:hover{
|
||||||
|
-fx-opacity: 1;
|
||||||
|
}
|
||||||
|
#servercontainer .toggle-button:selected{
|
||||||
|
-fx-opacity: 1;
|
||||||
|
-fx-background-image: url('images/icons/server_hover.png');
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-pane {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-bar:horizontal, .scroll-bar:vertical{
|
||||||
|
-fx-background-color:transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.increment-button, .decrement-button, .increment-arrow, .decrement-arrow {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-border-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-bar:horizontal .track,
|
||||||
|
.scroll-bar:vertical .track{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-border-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-bar:horizontal .thumb,
|
||||||
|
.scroll-bar:vertical .thumb {
|
||||||
|
-fx-background-color: rgba(0, 0, 0, 0.19);
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-bar{
|
||||||
|
-fx-font-size: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-pane > .corner {
|
||||||
|
-fx-background-color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
#discord_url{
|
||||||
|
-fx-opacity: 0.8;
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-background-image: url('images/icons/discord.png');
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
#settingsbtn{
|
||||||
|
-fx-opacity: 0.4;
|
||||||
|
-fx-background-position: center;
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
-fx-background-image: url('images/icons/settings.png');
|
||||||
|
}
|
||||||
|
#serverLaunch{
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
-fx-font-weight: bold;
|
||||||
|
-fx-font-size: 18pt;
|
||||||
|
-fx-background-color: #61B373;
|
||||||
|
-fx-text-fill: #ffffff;
|
||||||
|
}
|
||||||
|
#clientbtn{
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
-fx-background-color: #61B373;
|
||||||
|
-fx-background-image: url('images/icons/options.png');
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
#serverLaunch:hover, #serverLaunch:pressed, #clientbtn:hover, #clientbtn:pressed {
|
||||||
|
-fx-background-color: #74C085;
|
||||||
|
}
|
||||||
|
#settingsbtn:hover, #settingsbtn:pressed, #discord_url:hover, #discord_url:pressed, #hidebtn:hover, #hidebtn:pressed, #exitbtn:hover, #exitbtn:pressed { -fx-opacity: 1; }
|
86
Launcher/runtime/dialog/mainmenu.fxml
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import java.net.URL?>
|
||||||
|
<?import javafx.geometry.Insets?>
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
|
<?import javafx.scene.control.Label?>
|
||||||
|
<?import javafx.scene.control.ScrollPane?>
|
||||||
|
<?import javafx.scene.image.Image?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
|
<?import javafx.scene.layout.FlowPane?>
|
||||||
|
<?import javafx.scene.layout.Pane?>
|
||||||
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
|
<!-- DrLeonardo Design -->
|
||||||
|
|
||||||
|
<Pane fx:id="layout" maxHeight="-1.0" maxWidth="-1.0" prefHeight="400.0" prefWidth="600.0" visible="true" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
|
<children>
|
||||||
|
<ImageView id="sl_background" fitHeight="400.0" fitWidth="600.0">
|
||||||
|
<image>
|
||||||
|
<Image preserveRatio="true" smooth="true" url="@images/mainmenu/background.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<Pane id="serverPane" prefHeight="400.0" prefWidth="600.0">
|
||||||
|
<children>
|
||||||
|
<Button id="hidebtn" focusTraversable="false" layoutX="545.0" layoutY="2.0" minHeight="25.0" minWidth="20.0" prefHeight="25.0" prefWidth="25.0" textAlignment="CENTER" />
|
||||||
|
<Button id="exitbtn" alignment="CENTER" contentDisplay="CENTER" focusTraversable="false" layoutX="572.0" layoutY="2.0" minHeight="25.0" minWidth="20.0" prefHeight="25.0" prefWidth="25.0" rotate="360.0" textAlignment="CENTER" translateX="0.0" />
|
||||||
|
<ScrollPane id="serverlist" hbarPolicy="NEVER" layoutX="0.0" layoutY="27.0" prefHeight="306.0" prefWidth="171.0" visible="true">
|
||||||
|
<content>
|
||||||
|
<FlowPane id="servercontainer" alignment="TOP_LEFT" columnHalignment="LEFT" focusTraversable="false" hgap="0.0" maxHeight="0.0" maxWidth="0.0" orientation="HORIZONTAL" prefHeight="-1.0" prefWidth="161.0" prefWrapLength="0.0" rowValignment="TOP" vgap="7.0" visible="true">
|
||||||
|
<padding>
|
||||||
|
<Insets top="10.0" />
|
||||||
|
</padding>
|
||||||
|
</FlowPane>
|
||||||
|
</content>
|
||||||
|
</ScrollPane>
|
||||||
|
<ScrollPane id="serverinfo" hbarPolicy="NEVER" layoutX="170.0" layoutY="71.0" pannable="true" prefHeight="234.0" prefWidth="432.0" visible="true">
|
||||||
|
<content>
|
||||||
|
<FlowPane id="" focusTraversable="false" orientation="HORIZONTAL" prefHeight="234.0" prefWidth="428.0" rowValignment="TOP" visible="true">
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="10.0" left="15.0" top="7.0" />
|
||||||
|
</padding>
|
||||||
|
<children>
|
||||||
|
<Label id="serverDescription" alignment="TOP_LEFT" contentDisplay="LEFT" nodeOrientation="LEFT_TO_RIGHT" prefHeight="213.0" prefWidth="407.0" text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla convallis magna tellus, in bibendum tortor dignissim non. Phasellus vel tincidunt nulla, eu convallis ligula. Suspendisse ut diam vestibulum, tincidunt neque ut, posuere risus. Pellentesque posuere molestie eros, quis laoreet ante ornare quis. Morbi eu tortor fermentum, iaculis risus sit amet, fringilla augue. Aenean nulla purus, rutrum non sapien et, convallis tincidunt purus. Vivamus a eros pulvinar, dignissim leo lacinia, sodales nulla. Aliquam tortor augue, cursus a rutrum viverra, consequat non tellus. Donec porta nisl sed quam dictum commodo. Sed et vulputate dolor. Morbi ultrices justo vitae convallis semper. Donec sodales velit vel velit faucibus, et scelerisque felis finibus. Sed rutrum lacinia mauris, porta cursus mauris tempor eu. Duis turpis nulla, dictum vitae commodo rhoncus, pretium in turpis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos." textFill="#d3d3d3" wrapText="true">
|
||||||
|
<font>
|
||||||
|
<Font size="14.0" fx:id="x3" />
|
||||||
|
</font>
|
||||||
|
</Label>
|
||||||
|
</children>
|
||||||
|
</FlowPane>
|
||||||
|
</content>
|
||||||
|
</ScrollPane>
|
||||||
|
<Pane id="serverentrance" layoutX="170.0" layoutY="27.0" prefHeight="372.0" prefWidth="430.0">
|
||||||
|
<children>
|
||||||
|
<Button id="serverLaunch" layoutX="180.0" layoutY="294.0" mnemonicParsing="false" prefHeight="60.0" prefWidth="182.0" text="ИГРАТЬ">
|
||||||
|
<font>
|
||||||
|
<Font size="22.0" />
|
||||||
|
</font>
|
||||||
|
</Button>
|
||||||
|
<Button id="clientbtn" layoutX="363.0" layoutY="294.0" mnemonicParsing="false" prefHeight="60.0" prefWidth="50.0" text="" />
|
||||||
|
<Label id="serverStatus" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="14.0" layoutY="312.0" opacity="0.61" prefHeight="25.0" prefWidth="153.0" text="12/100" textAlignment="RIGHT" textFill="WHITE">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="16.0" />
|
||||||
|
</font>
|
||||||
|
</Label>
|
||||||
|
<Label id="serverLabel" layoutX="2.0" layoutY="11.0" prefHeight="40.0" prefWidth="274.0" text="СЕРВЕР IFARM">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="18.0" />
|
||||||
|
</font>
|
||||||
|
<padding>
|
||||||
|
<Insets left="14.0" />
|
||||||
|
</padding>
|
||||||
|
</Label>
|
||||||
|
<Button id="discord_url" alignment="BOTTOM_CENTER" contentDisplay="CENTER" layoutX="386.0" layoutY="23.0" minHeight="16.0" minWidth="28.0" mnemonicParsing="false" prefHeight="16.0" prefWidth="28.0" text="" textAlignment="CENTER" />
|
||||||
|
</children>
|
||||||
|
|
||||||
|
</Pane>
|
||||||
|
<Button id="logoutbtn" layoutX="19.0" layoutY="350.0" mnemonicParsing="false" prefHeight="31.0" prefWidth="133.0" styleClass="logoutbtn" text="Выйти" />
|
||||||
|
<Button id="settingsbtn" alignment="CENTER" contentDisplay="CENTER" layoutX="518.0" layoutY="2.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="25.0" text="" textAlignment="CENTER" />
|
||||||
|
</children>
|
||||||
|
</Pane>
|
||||||
|
<Pane id="mask" opacity="0.0" prefHeight="400.0" prefWidth="600.0" visible="false" />
|
||||||
|
</children>
|
||||||
|
<stylesheets>
|
||||||
|
<URL value="@mainmenu.css" />
|
||||||
|
</stylesheets>
|
||||||
|
</Pane>
|
19
Launcher/runtime/dialog/offline/describe.html
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body style="background-color: rgba(0,0,0,0);">
|
||||||
|
<div style="color:#ffbb19; text-shadow: 1px 1px 2px black; width:300px;">
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent sodales blandit turpis et imperdiet. Nunc egestas ipsum vitae mauris euismod euismod. Curabitur ut posuere odio. Donec sagittis faucibus commodo. Aenean id nunc sem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed id nunc lorem. Mauris iaculis, felis et sollicitudin faucibus, nisi nisl dapibus libero, ac venenatis tellus nibh sit amet ex. Duis sit amet nisi vitae mi venenatis mollis semper sollicitudin tortor. Interdum et malesuada fames ac ante ipsum primis in faucibus. Praesent et risus in quam ornare ullamcorper nec sed arcu. Cras eget libero augue. Duis nisl tellus, pulvinar non dolor at, scelerisque vestibulum erat. Quisque eu augue aliquet, rhoncus nunc non, pellentesque est.
|
||||||
|
|
||||||
|
Vivamus ut ipsum lacinia erat faucibus interdum eget sed neque. Curabitur vestibulum quis ante ac euismod. Morbi consequat ante quam, ut hendrerit ligula sagittis nec. Fusce pretium in turpis vel aliquet. Duis malesuada nulla ut interdum maximus. Phasellus commodo enim a ligula aliquam, sed semper nisl posuere. Vestibulum gravida mi nisl, vel porta nisl sollicitudin a. Quisque dui massa, ullamcorper a dolor vel, viverra fermentum dolor. Mauris condimentum lacinia mauris at rhoncus. Nullam sed mollis ex. Sed magna purus, varius et imperdiet at, porta eu erat. Pellentesque eu ornare nibh. Quisque vel eros sit amet tellus elementum venenatis. Etiam id elit elit. Phasellus malesuada et augue sit amet consequat.
|
||||||
|
|
||||||
|
Mauris viverra ipsum at laoreet porttitor. Maecenas interdum egestas risus eget aliquet. Sed vestibulum arcu ut odio bibendum consequat. Etiam ultrices dui vitae dolor dignissim, in accumsan erat aliquet. Vivamus eu justo vitae mauris molestie suscipit. Donec dui erat, posuere eget ipsum quis, consequat porta neque. Donec hendrerit mi ac consectetur lacinia. Nullam aliquet nisi at tincidunt venenatis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque turpis nulla, consequat non volutpat id, vehicula vitae nulla. Aenean pulvinar aliquam felis, ut dictum sem pretium vel. Vestibulum eget sollicitudin justo. Fusce in erat massa. Donec imperdiet justo vitae imperdiet laoreet. Donec pretium, lacus non accumsan sollicitudin, ex nisl maximus risus, semper lacinia lectus leo vel metus. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||||
|
|
||||||
|
Curabitur sit amet orci iaculis, venenatis sapien vel, dignissim arcu. Etiam tincidunt ac enim nec faucibus. Nullam fringilla ultrices sagittis. Quisque ac risus augue. Etiam neque ligula, convallis ut fermentum condimentum, mattis a libero. Aenean purus leo, semper vel hendrerit quis, ornare sit amet dui. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin nisl neque, tempor eu erat at, suscipit vulputate lacus. Quisque facilisis interdum posuere. Nam tortor metus, placerat at dapibus ac, tincidunt nec est. Pellentesque consequat risus vitae condimentum pulvinar. Aenean hendrerit, magna vitae ornare dignissim, lorem ipsum venenatis ex, et auctor mauris massa a eros.
|
||||||
|
|
||||||
|
Mauris tellus augue, condimentum ut tempor eget, facilisis quis ipsum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec fermentum in purus imperdiet feugiat. Cras vitae felis nisi. Duis sed justo condimentum, efficitur enim ut, pretium velit. Sed ac vestibulum lorem. Nullam pharetra, neque id mollis lobortis, augue odio ullamcorper quam, et dignissim nunc arcu nec arcu. Integer ac purus semper, scelerisque est sed, posuere lorem. Vivamus metus ante, placerat eget scelerisque id, dapibus ut nisi. Interdum et malesuada fames ac ante ipsum primis in faucibus.
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -5,11 +5,11 @@
|
||||||
<title>Offline-режим</title>
|
<title>Offline-режим</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body style="color:red">
|
||||||
<h2>Offline-режим</h2>
|
<h2>Offline-режим</h2>
|
||||||
Лаунчер запущен в Offline-режиме. В этом режиме Вы можете запустить любой ранее загруженный клиент
|
Лаунчер запущен в Offline-режиме. В этом режиме Вы можете запустить любой ранее загруженный клиент
|
||||||
с любым именем пользователя, при этом вход на серверы с авторизацией, а так же система скинов и плащей <b>не работает</b>.
|
с любым именем пользователя, при этом вход на серверы с авторизацией, а так же система скинов и плащей <b>может не работать</b>.
|
||||||
Скорее всего, проблема вызвана неполадками в интернет-подключении или сбоем на сервере.
|
Скорее всего, проблема вызвана сбоем на сервере или неполадками в интернет-подключении.
|
||||||
Проверьте состояние интернет-подключения или обратитесь к администратору сервера.
|
Проверьте состояние интернет-подключения или обратитесь к администратору сервера.
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -3,17 +3,20 @@
|
||||||
/* Output */
|
/* Output */
|
||||||
#overlay > #output {
|
#overlay > #output {
|
||||||
-fx-background-color: white;
|
-fx-background-color: white;
|
||||||
|
-fx-background-radius: 0;
|
||||||
-fx-font-family: monospace;
|
-fx-font-family: monospace;
|
||||||
-fx-font-size: 8pt;
|
-fx-font-size: 8pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overlay > #output .content {
|
#overlay > #output .content {
|
||||||
-fx-background-color: white;
|
-fx-background-color: white;
|
||||||
|
-fx-background-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Close button */
|
/* Close button */
|
||||||
#overlay > #copy,
|
#overlay > #copy,
|
||||||
#overlay > #action.close {
|
#overlay > #action.close {
|
||||||
|
-fx-background-radius: 0;
|
||||||
-fx-background-color: rgba(33,133,208,.5);
|
-fx-background-color: rgba(33,133,208,.5);
|
||||||
-fx-text-fill: white;
|
-fx-text-fill: white;
|
||||||
}
|
}
|
||||||
|
@ -32,6 +35,7 @@ #overlay > #action.close:pressed {
|
||||||
|
|
||||||
/* Kill button */
|
/* Kill button */
|
||||||
#overlay > #action.kill {
|
#overlay > #action.kill {
|
||||||
|
-fx-background-radius: 0;
|
||||||
-fx-background-color: rgba(219,40,40,.5);
|
-fx-background-color: rgba(219,40,40,.5);
|
||||||
-fx-text-fill: white;
|
-fx-text-fill: white;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,13 +5,15 @@
|
||||||
<?import javafx.scene.control.TextArea?>
|
<?import javafx.scene.control.TextArea?>
|
||||||
<?import javafx.scene.layout.Pane?>
|
<?import javafx.scene.layout.Pane?>
|
||||||
|
|
||||||
<Pane xmlns:fx="http://javafx.com/fxml/1" fx:id="overlay" prefWidth="580.0" prefHeight="380.0">
|
<!-- DrLeonardo Design -->
|
||||||
|
|
||||||
|
<Pane fx:id="overlay" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/10.0.1">
|
||||||
<stylesheets>
|
<stylesheets>
|
||||||
<URL value="@debug.css" />
|
<URL value="@debug.css" />
|
||||||
</stylesheets>
|
</stylesheets>
|
||||||
|
|
||||||
<!-- Debug controls -->
|
<!-- Debug controls -->
|
||||||
<TextArea fx:id="output" layoutX="5.0" layoutY="5.0" prefWidth="570.0" prefHeight="370.0" />
|
<TextArea fx:id="output" layoutY="28.0" prefHeight="372.0" prefWidth="600.0" />
|
||||||
<Button fx:id="copy" layoutX="365.0" layoutY="340.0" prefWidth="100.0" prefHeight="30.0" text="Копировать" defaultButton="true" />
|
<Button fx:id="copy" defaultButton="true" layoutX="375.0" layoutY="352.0" prefHeight="30.0" prefWidth="100.0" text="Копировать" />
|
||||||
<Button fx:id="action" layoutX="470.0" layoutY="340.0" prefWidth="100.0" prefHeight="30.0" />
|
<Button fx:id="action" layoutX="480.0" layoutY="352.0" prefHeight="30.0" prefWidth="100.0" />
|
||||||
</Pane>
|
</Pane>
|
||||||
|
|
43
Launcher/runtime/dialog/overlay/options/options.css
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
#holder {
|
||||||
|
-fx-background-color: #fff;
|
||||||
|
}
|
||||||
|
/* Labels */
|
||||||
|
#holder > #settingsTitle {
|
||||||
|
-fx-font-size: 14pt;
|
||||||
|
-fx-alignment: baseline-center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#holder > #apply{
|
||||||
|
-fx-background-color: #61B373;
|
||||||
|
-fx-text-fill: #fff;
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
}
|
||||||
|
#holder > #apply:hover,
|
||||||
|
#holder > #apply:focused{
|
||||||
|
-fx-background-color: #74C085;
|
||||||
|
}
|
||||||
|
|
||||||
|
.check-box{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-text-fill:#2c2c2c;
|
||||||
|
-fx-font-size: 13;
|
||||||
|
-fx-background-image: url('../../images/icons/checkbox.png');
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
.check-box .mark {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
.check-box .box {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
.check-box:selected{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-background-image: url('../../images/icons/checkbox_checked.png');
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
.check-box:selected .mark {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
.check-box:selected .box {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
29
Launcher/runtime/dialog/overlay/options/options.fxml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import java.net.URL?>
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
|
<?import javafx.scene.control.CheckBox?>
|
||||||
|
<?import javafx.scene.layout.Pane?>
|
||||||
|
<?import javafx.scene.text.Text?>
|
||||||
|
|
||||||
|
<!-- DrLeonardo Design -->
|
||||||
|
|
||||||
|
<Pane fx:id="overlay" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
|
<children>
|
||||||
|
<Pane id="holder" layoutX="171.0" layoutY="28.0" prefHeight="372.0" prefWidth="429.0">
|
||||||
|
<children>
|
||||||
|
<CheckBox fx:id="modid_0" layoutX="14.0" layoutY="14.0" text="NEI" />
|
||||||
|
<Button fx:id="apply" defaultButton="true" layoutX="315.0" layoutY="333.0" prefHeight="25.0" prefWidth="100.0" text="Применить" />
|
||||||
|
<Text fill="#8c8c8c" layoutX="38.0" layoutY="29.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Включение авто-входа означает что вы сразу после загрузки клиента попадете на сервер" wrappingWidth="379.00000374019146" y="15.0" />
|
||||||
|
<CheckBox fx:id="modid_1" layoutX="14.0" layoutY="108.0" text="BetterFoliage" />
|
||||||
|
<CheckBox fx:id="modid_2" layoutX="14.0" layoutY="166.0" text="Schematica" />
|
||||||
|
<CheckBox fx:id="modid_3" layoutX="39.0" layoutY="73.0" text="NEI Addons" />
|
||||||
|
<Text fill="#8c8c8c" layoutX="38.0" layoutY="121.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Мод довольно сильно преобразит игру, мир обзаведется густой растительностью: изменится трава и листья" wrappingWidth="379.00000374019146" y="15.0" />
|
||||||
|
<Text fill="#8c8c8c" layoutX="38.0" layoutY="180.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Позволит вам смотреть файлы с расширением schematic прямо в вашем игровом мире" wrappingWidth="379.00000374019146" y="15.0" />
|
||||||
|
</children>
|
||||||
|
</Pane>
|
||||||
|
</children>
|
||||||
|
<stylesheets>
|
||||||
|
<URL value="@options.css" />
|
||||||
|
</stylesheets>
|
||||||
|
</Pane>
|
50
Launcher/runtime/dialog/overlay/options/options.js
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
var options = {
|
||||||
|
file: DirBridge.dir.resolve("options.bin"), // options file
|
||||||
|
autoEnter: false, // Client
|
||||||
|
|
||||||
|
/* options and overlay functions */
|
||||||
|
load: function() {
|
||||||
|
LogHelper.debug("Loading options file");
|
||||||
|
try {
|
||||||
|
tryWithResources(new HInput(IOHelper.newInput(options.file)), options.read);
|
||||||
|
} catch(e) {
|
||||||
|
LogHelper.error(e);
|
||||||
|
//options.setDefault();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
save: function() {
|
||||||
|
LogHelper.debug("Saving options file");
|
||||||
|
try {
|
||||||
|
tryWithResources(new HOutput(IOHelper.newOutput(options.file)), options.write);
|
||||||
|
} catch(e) {
|
||||||
|
LogHelper.error(e);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Internal functions
|
||||||
|
read: function(input) {
|
||||||
|
var magic = input.readInt();
|
||||||
|
if (magic != config.settingsMagic) {
|
||||||
|
throw new java.io.IOException("options magic mismatch: " + java.lang.Integer.toString(magic, 16));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
write: function(output) {
|
||||||
|
output.writeInt(config.settingsMagic);
|
||||||
|
},
|
||||||
|
|
||||||
|
/* ===================== OVERLAY ===================== */
|
||||||
|
count: 0,
|
||||||
|
|
||||||
|
initOverlay: function() {
|
||||||
|
options.overlay = loadFXML("dialog/overlay/options/options.fxml");
|
||||||
|
|
||||||
|
// Lookup autoEnter checkbox
|
||||||
|
var holder = options.overlay.lookup("#holder");
|
||||||
|
|
||||||
|
// Lookup apply settings button
|
||||||
|
holder.lookup("#apply").setOnAction(function(event) overlay.hide(0, null));
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
Before Width: | Height: | Size: 584 B After Width: | Height: | Size: 894 B |
|
@ -1,8 +1,7 @@
|
||||||
@import url(../../styles/common.css);
|
|
||||||
|
|
||||||
/* Label */
|
/* Label */
|
||||||
#overlay > #description {
|
#overlay > #description {
|
||||||
-fx-font-size: 12pt;
|
-fx-font-size: 12pt;
|
||||||
|
-fx-text-fill: #fff;
|
||||||
-fx-wrap-text: true;
|
-fx-wrap-text: true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,16 +6,25 @@
|
||||||
<?import javafx.scene.image.ImageView?>
|
<?import javafx.scene.image.ImageView?>
|
||||||
<?import javafx.scene.layout.Pane?>
|
<?import javafx.scene.layout.Pane?>
|
||||||
|
|
||||||
<Pane xmlns:fx="http://javafx.com/fxml/1" fx:id="overlay" prefWidth="400.0" prefHeight="100.0">
|
<!-- DrLeonardo Design -->
|
||||||
|
|
||||||
|
<Pane fx:id="overlay" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
|
<children>
|
||||||
|
<ImageView fitHeight="161.0" fitWidth="161.0" layoutX="220.0" layoutY="94.0" y="-6.0">
|
||||||
|
<image>
|
||||||
|
<Image url="@../../images/icons/loading.gif" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<!-- Icon image -->
|
||||||
|
<ImageView id="spinner" fx:id="spinner" blendMode="COLOR_BURN" fitHeight="79.0" fitWidth="79.0" layoutX="261.0" layoutY="116.0" preserveRatio="true">
|
||||||
|
<image>
|
||||||
|
<Image url="@error.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<!-- Description -->
|
||||||
|
<Label fx:id="description" alignment="CENTER" contentDisplay="CENTER" layoutX="159.0" layoutY="249.0" prefHeight="64.0" prefWidth="283.0" text="..." textAlignment="CENTER" />
|
||||||
|
</children>
|
||||||
<stylesheets>
|
<stylesheets>
|
||||||
<URL value="@processing.css" />
|
<URL value="@processing.css" />
|
||||||
</stylesheets>
|
</stylesheets>
|
||||||
|
|
||||||
<!-- Icon image -->
|
|
||||||
<ImageView fx:id="spinner" layoutX="26.0" layoutY="26.0">
|
|
||||||
<Image url="@spinner.gif" />
|
|
||||||
</ImageView>
|
|
||||||
|
|
||||||
<!-- Description -->
|
|
||||||
<Label fx:id="description" layoutX="100.0" layoutY="10.0" prefWidth="290.0" prefHeight="80.0" text="..." />
|
|
||||||
</Pane>
|
</Pane>
|
||||||
|
|
|
@ -11,7 +11,7 @@ var processing = {
|
||||||
|
|
||||||
// Set images
|
// Set images
|
||||||
processing.processingImage = new javafx.scene.image.Image(
|
processing.processingImage = new javafx.scene.image.Image(
|
||||||
Launcher.getResourceURL("dialog/overlay/processing/spinner.gif").toString());
|
Launcher.getResourceURL("dialog/images/icons/loading.gif").toString());
|
||||||
processing.errorImage = new javafx.scene.image.Image(
|
processing.errorImage = new javafx.scene.image.Image(
|
||||||
Launcher.getResourceURL("dialog/overlay/processing/error.png").toString());
|
Launcher.getResourceURL("dialog/overlay/processing/error.png").toString());
|
||||||
},
|
},
|
||||||
|
@ -99,6 +99,22 @@ function makeProfilesRequest(callback) {
|
||||||
task.updateMessage("Обновление списка серверов");
|
task.updateMessage("Обновление списка серверов");
|
||||||
startTask(task);
|
startTask(task);
|
||||||
}
|
}
|
||||||
|
function makeSetProfileRequest(profile, callback) {
|
||||||
|
var task = newRequestTask(new SetProfileRequest(Launcher.getConfig(), profile));
|
||||||
|
|
||||||
|
// Set task properties and start
|
||||||
|
processing.setTaskProperties(task, callback, function() {
|
||||||
|
if (settings.offline) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Repeat request, but in offline mode
|
||||||
|
settings.offline = true;
|
||||||
|
overlay.swap(2500, processing.overlay, function() makeProfilesRequest(callback));
|
||||||
|
}, false);
|
||||||
|
task.updateMessage("Синхронизация профиля");
|
||||||
|
startTask(task);
|
||||||
|
}
|
||||||
|
|
||||||
function makeAuthRequest(login, rsaPassword, callback) {
|
function makeAuthRequest(login, rsaPassword, callback) {
|
||||||
var task = rsaPassword === null ? newTask(offlineAuthRequest(login)) :
|
var task = rsaPassword === null ? newTask(offlineAuthRequest(login)) :
|
||||||
|
|
Before Width: | Height: | Size: 27 KiB |
|
@ -1,50 +1,99 @@
|
||||||
@import url(../../styles/common.css);
|
#holder {
|
||||||
|
-fx-background-color: #fff;
|
||||||
|
}
|
||||||
/* Labels */
|
/* Labels */
|
||||||
#overlay > #settingsTitle {
|
#holder > #settingsTitle {
|
||||||
-fx-font-size: 14pt;
|
-fx-font-size: 14pt;
|
||||||
-fx-alignment: baseline-center;
|
-fx-alignment: baseline-center;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overlay #ramLabel,
|
#holder #ramLabel,
|
||||||
#overlay #dirLabel {
|
#holder #dirLabel,
|
||||||
|
#holder #dirChange {
|
||||||
-fx-font-weight: bold;
|
-fx-font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* RAM slider */
|
/* RAM slider */
|
||||||
#overlay > #ramSlider > .track {
|
#holder > #ramSlider > .track {
|
||||||
-fx-background-color: #D8E0E3;
|
-fx-background-color: #D8E0E3;
|
||||||
-fx-background-insets: none;
|
-fx-background-insets: none;
|
||||||
-fx-background-radius: 2px;
|
-fx-background-radius: 2px;
|
||||||
-fx-padding: 2px;
|
-fx-padding: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overlay > #ramSlider > .thumb {
|
#holder > #ramSlider > .thumb {
|
||||||
-fx-background-color: #3498DB;
|
-fx-background-color: #3498DB;
|
||||||
-fx-background-insets: none;
|
-fx-background-insets: none;
|
||||||
-fx-background-radius: 5px;
|
-fx-background-radius: 5px;
|
||||||
-fx-padding: 5px;
|
-fx-padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overlay > #ramSlider:hover > .thumb {
|
#holder > #ramSlider:hover > .thumb {
|
||||||
-fx-background-color: #2F8BC8;
|
-fx-background-color: #2F8BC8;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overlay > #ramSlider:pressed > .thumb {
|
#holder > #ramSlider:pressed > .thumb {
|
||||||
-fx-background-color: #2876AA;
|
-fx-background-color: #2876AA;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dir options */
|
/* Dir options */
|
||||||
#overlay > #deleteDir {
|
#holder > #deleteDir {
|
||||||
-fx-background-color: #DB2828;
|
-fx-background-color: #CE5757;
|
||||||
-fx-text-fill: white;
|
-fx-text-fill: white;
|
||||||
|
-fx-background-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overlay > #deleteDir:hover,
|
#holder > #deleteDir:hover,
|
||||||
#overlay > #deleteDir:focused {
|
#holder > #deleteDir:focused {
|
||||||
-fx-background-color: #CA1010;
|
-fx-opacity: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overlay > #deleteDir:pressed {
|
#holder > #changeDir {
|
||||||
-fx-background-color: #B21E1E;
|
-fx-background-color: #B4B4B4;
|
||||||
|
-fx-text-fill: white;
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#holder > #changeDir:hover,
|
||||||
|
#holder > #changeDir:focused {
|
||||||
|
-fx-opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
#holder > #changeDir:pressed {
|
||||||
|
-fx-opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
#holder > #apply{
|
||||||
|
-fx-background-color: #61B373;
|
||||||
|
-fx-text-fill: #fff;
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
}
|
||||||
|
#holder > #apply:hover,
|
||||||
|
#holder > #apply:focused{
|
||||||
|
-fx-background-color: #74C085;
|
||||||
|
}
|
||||||
|
|
||||||
|
.check-box{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-text-fill:#2c2c2c;
|
||||||
|
-fx-font-size: 13;
|
||||||
|
-fx-background-image: url('../../images/icons/checkbox.png');
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
.check-box .mark {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
.check-box .box {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
.check-box:selected{
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-background-image: url('../../images/icons/checkbox_checked.png');
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
.check-box:selected .mark {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
}
|
||||||
|
.check-box:selected .box {
|
||||||
|
-fx-background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,38 +8,42 @@
|
||||||
<?import javafx.scene.control.Separator?>
|
<?import javafx.scene.control.Separator?>
|
||||||
<?import javafx.scene.control.Slider?>
|
<?import javafx.scene.control.Slider?>
|
||||||
<?import javafx.scene.layout.Pane?>
|
<?import javafx.scene.layout.Pane?>
|
||||||
|
<?import javafx.scene.text.Font?>
|
||||||
<?import javafx.scene.text.Text?>
|
<?import javafx.scene.text.Text?>
|
||||||
<?import javafx.scene.text.TextFlow?>
|
<?import javafx.scene.text.TextFlow?>
|
||||||
|
|
||||||
<Pane xmlns:fx="http://javafx.com/fxml/1" fx:id="overlay" prefWidth="500.0" prefHeight="250.0">
|
<!-- DrLeonardo Design -->
|
||||||
|
|
||||||
|
<Pane fx:id="overlay" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
|
<children>
|
||||||
|
<Pane id="holder" layoutY="28.0" prefHeight="372.0" prefWidth="600.0">
|
||||||
|
<children>
|
||||||
|
<CheckBox fx:id="autoEnter" layoutX="14.0" layoutY="80.0" text="Автовход на сервер" />
|
||||||
|
<CheckBox fx:id="fullScreen" layoutX="13.0" layoutY="185.0" text="Клиент в полный экран" />
|
||||||
|
|
||||||
|
<!-- RAM settings -->
|
||||||
|
<TextFlow layoutX="20.0" layoutY="70.0" />
|
||||||
|
<Slider fx:id="ramSlider" layoutX="18.0" layoutY="36.0" prefHeight="3.0" prefWidth="563.0" />
|
||||||
|
<Separator layoutY="65.0" prefHeight="1.0" prefWidth="600.0" />
|
||||||
|
<Label id="" alignment="CENTER_LEFT" layoutX="18.0" layoutY="16.0" prefHeight="17.0" prefWidth="217.0" text="Лимит памяти для клиента ОЗУ (RAM)" textFill="#2f2f2f" />
|
||||||
|
<!-- RAM settings -->
|
||||||
|
|
||||||
|
<Button fx:id="deleteDir" layoutX="15.0" layoutY="333.0" prefHeight="25.0" prefWidth="245.0" text="Очистить данные игровых клиентов" textAlignment="CENTER" wrapText="true">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="12.0" />
|
||||||
|
</font></Button>
|
||||||
|
<Button fx:id="changeDir" layoutX="14.0" layoutY="229.0" prefHeight="25.0" prefWidth="200.0" text="Сменить директорию загрузки" textAlignment="CENTER" wrapText="true" />
|
||||||
|
<Hyperlink id="dirLabel" alignment="TOP_LEFT" layoutX="215.0" layoutY="230.0" prefHeight="23.0" prefWidth="371.0" text="C:/Users" wrapText="true" />
|
||||||
|
<Button fx:id="apply" defaultButton="true" layoutX="486.0" layoutY="335.0" prefHeight="23.0" prefWidth="100.0" text="Применить" />
|
||||||
|
<CheckBox id="debug" layoutX="13.0" layoutY="124.0" text="Режим Откладки" />
|
||||||
|
<Text fill="#8c8c8c" layoutX="38.0" layoutY="95.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Включение авто-входа означает что вы сразу после загрузки клиента попадете на сервер" wrappingWidth="533.0000102519989" y="15.0" />
|
||||||
|
<Text fill="#8c8c8c" layoutX="38.0" layoutY="139.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Режим отладки позволяет просмотреть лог запуска и работы программы в реальном времени прямо из лаунчера, что упрощает поиск нужной информации" wrappingWidth="533.0000016447157" y="15.0" />
|
||||||
|
<Text fill="#8c8c8c" layoutX="38.0" layoutY="200.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Включение данной функции позволяет запустить игру сразу в полноэкранном режиме" wrappingWidth="533.0000102519989" y="15.0" />
|
||||||
|
<Label fx:id="ramLabel" alignment="CENTER_RIGHT" layoutX="481.0" layoutY="17.0" prefWidth="100.0" text="RAM" />
|
||||||
|
</children>
|
||||||
|
</Pane>
|
||||||
|
</children>
|
||||||
<stylesheets>
|
<stylesheets>
|
||||||
<URL value="@settings.css" />
|
<URL value="@settings.css" />
|
||||||
</stylesheets>
|
</stylesheets>
|
||||||
|
|
||||||
<!-- Settings -->
|
|
||||||
<Label fx:id="settingsTitle" layoutX="20.0" layoutY="5.0" prefWidth="460.0" text="Настройки" />
|
|
||||||
<Separator layoutX="20.0" layoutY="35.0" prefWidth="460.0" />
|
|
||||||
<CheckBox fx:id="autoEnter" layoutX="20.0" layoutY="45.0" text="Автовход на сервер" />
|
|
||||||
<CheckBox fx:id="fullScreen" layoutX="250.0" layoutY="45.0" text="Клиент в полный экран" />
|
|
||||||
|
|
||||||
<!-- RAM settings -->
|
|
||||||
<TextFlow layoutX="20.0" layoutY="70.0">
|
|
||||||
<Text>Выделение памяти: </Text>
|
|
||||||
<Text fx:id="ramLabel" />
|
|
||||||
</TextFlow>
|
|
||||||
<Slider fx:id="ramSlider" layoutX="20.0" layoutY="90.0" prefWidth="460.0" />
|
|
||||||
<Separator layoutX="20.0" layoutY="135.0" prefWidth="460.0" />
|
|
||||||
|
|
||||||
<!-- Dir settings -->
|
|
||||||
<TextFlow layoutX="20.0" layoutY="135.0">
|
|
||||||
<Text>Директория загрузок: </Text>
|
|
||||||
<Hyperlink fx:id="dirLabel" />
|
|
||||||
</TextFlow>
|
|
||||||
<Button fx:id="changeDir" layoutX="20.0" layoutY="160.0" prefWidth="225.0" prefHeight="30.0" text="Сменить директорию" />
|
|
||||||
<Button fx:id="deleteDir" layoutX="255.0" layoutY="160.0" prefWidth="225.0" prefHeight="30.0" text="Удалить всё содержимое" />
|
|
||||||
<Separator layoutX="20.0" layoutY="200.0" prefWidth="460.0" />
|
|
||||||
|
|
||||||
<!-- Debug checkbox and apply button -->
|
|
||||||
<CheckBox fx:id="debug" layoutX="20.0" layoutY="210.0" prefHeight="30.0" text="Режим отладки" />
|
|
||||||
<Button fx:id="apply" layoutX="390.0" layoutY="210.0" prefWidth="100.0" prefHeight="30.0" text="Применить" defaultButton="true" />
|
|
||||||
</Pane>
|
</Pane>
|
||||||
|
|
|
@ -37,45 +37,21 @@ var settingsOverlay = {
|
||||||
settingsOverlay.overlay = loadFXML("dialog/overlay/settings/settings.fxml");
|
settingsOverlay.overlay = loadFXML("dialog/overlay/settings/settings.fxml");
|
||||||
|
|
||||||
// Lookup autoEnter checkbox
|
// Lookup autoEnter checkbox
|
||||||
var autoEnterBox = settingsOverlay.overlay.lookup("#autoEnter");
|
var holder = settingsOverlay.overlay.lookup("#holder");
|
||||||
|
|
||||||
|
var autoEnterBox = holder.lookup("#autoEnter");
|
||||||
autoEnterBox.setSelected(settings.autoEnter);
|
autoEnterBox.setSelected(settings.autoEnter);
|
||||||
autoEnterBox.selectedProperty()["addListener(javafx.beans.value.ChangeListener)"](
|
autoEnterBox.selectedProperty()["addListener(javafx.beans.value.ChangeListener)"](
|
||||||
function(o, ov, nv) settings.autoEnter = nv);
|
function(o, ov, nv) settings.autoEnter = nv);
|
||||||
|
|
||||||
// Lookup fullScreen checkbox
|
|
||||||
var fullScreenBox = settingsOverlay.overlay.lookup("#fullScreen");
|
|
||||||
fullScreenBox.setSelected(settings.fullScreen);
|
|
||||||
fullScreenBox.selectedProperty()["addListener(javafx.beans.value.ChangeListener)"](
|
|
||||||
function(o, ov, nv) settings.fullScreen = nv);
|
|
||||||
|
|
||||||
// Lookup RAM label
|
|
||||||
settingsOverlay.ramLabel = settingsOverlay.overlay.lookup("#ramLabel");
|
|
||||||
settingsOverlay.updateRAMLabel();
|
|
||||||
|
|
||||||
// Lookup RAM slider options
|
|
||||||
var ramSlider = settingsOverlay.overlay.lookup("#ramSlider");
|
|
||||||
ramSlider.setMin(0);
|
|
||||||
ramSlider.setMax(JVMHelper.RAM);
|
|
||||||
ramSlider.setSnapToTicks(true);
|
|
||||||
ramSlider.setShowTickMarks(true);
|
|
||||||
ramSlider.setShowTickLabels(true);
|
|
||||||
ramSlider.setMinorTickCount(3);
|
|
||||||
ramSlider.setMajorTickUnit(1024);
|
|
||||||
ramSlider.setBlockIncrement(1024);
|
|
||||||
ramSlider.setValue(settings.ram);
|
|
||||||
ramSlider.valueProperty()["addListener(javafx.beans.value.ChangeListener)"](function(o, ov, nv) {
|
|
||||||
settings.setRAM(nv);
|
|
||||||
settingsOverlay.updateRAMLabel();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Lookup dir label
|
// Lookup dir label
|
||||||
settingsOverlay.dirLabel = settingsOverlay.overlay.lookup("#dirLabel");
|
settingsOverlay.dirLabel = holder.lookup("#dirLabel");
|
||||||
settingsOverlay.dirLabel.setOnAction(function(event)
|
settingsOverlay.dirLabel.setOnAction(function(event)
|
||||||
app.getHostServices().showDocument(settings.updatesDir.toUri()));
|
app.getHostServices().showDocument(settings.updatesDir.toUri()));
|
||||||
settingsOverlay.updateDirLabel();
|
settingsOverlay.updateDirLabel();
|
||||||
|
|
||||||
// Lookup change dir button
|
// Lookup change dir button
|
||||||
settingsOverlay.overlay.lookup("#changeDir").setOnAction(function(event) {
|
holder.lookup("#changeDir").setOnAction(function(event) {
|
||||||
var chooser = new javafx.stage.DirectoryChooser();
|
var chooser = new javafx.stage.DirectoryChooser();
|
||||||
chooser.setTitle("Сменить директорию загрузок");
|
chooser.setTitle("Сменить директорию загрузок");
|
||||||
chooser.setInitialDirectory(DirBridge.dir.toFile());
|
chooser.setInitialDirectory(DirBridge.dir.toFile());
|
||||||
|
@ -84,23 +60,58 @@ var settingsOverlay = {
|
||||||
var newDir = chooser.showDialog(stage);
|
var newDir = chooser.showDialog(stage);
|
||||||
if (newDir !== null) {
|
if (newDir !== null) {
|
||||||
settings.updatesDir = newDir.toPath();
|
settings.updatesDir = newDir.toPath();
|
||||||
settings.updateDirLabel();
|
settingsOverlay.updateDirLabel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Lookup fullScreen checkbox
|
||||||
|
var fullScreenBox = holder.lookup("#fullScreen");
|
||||||
|
fullScreenBox.setSelected(settings.fullScreen);
|
||||||
|
fullScreenBox.selectedProperty()["addListener(javafx.beans.value.ChangeListener)"](
|
||||||
|
function(o, ov, nv) settings.fullScreen = nv);
|
||||||
|
|
||||||
|
// Lookup RAM label
|
||||||
|
settingsOverlay.ramLabel = holder.lookup("#ramLabel");
|
||||||
|
settingsOverlay.updateRAMLabel();
|
||||||
|
|
||||||
|
// Lookup RAM slider options
|
||||||
|
var ramSlider = holder.lookup("#ramSlider");
|
||||||
|
ramSlider.setMin(0);
|
||||||
|
ramSlider.setMax(JVMHelper.RAM);
|
||||||
|
ramSlider.setSnapToTicks(true);
|
||||||
|
ramSlider.setMinorTickCount(3);
|
||||||
|
//ramSlider.setMajorTickUnit(1024);
|
||||||
|
//ramSlider.setBlockIncrement(1024);
|
||||||
|
ramSlider.setValue(settings.ram);
|
||||||
|
ramSlider.valueProperty()["addListener(javafx.beans.value.ChangeListener)"](function(o, ov, nv) {
|
||||||
|
settings.setRAM(nv);
|
||||||
|
settingsOverlay.updateRAMLabel();
|
||||||
|
});
|
||||||
|
|
||||||
// Lookup delete dir button
|
// Lookup delete dir button
|
||||||
var deleteDirButton = settingsOverlay.overlay.lookup("#deleteDir");
|
var deleteDirButton = holder.lookup("#deleteDir");
|
||||||
deleteDirButton.setOnAction(function(event) {
|
deleteDirButton.setOnAction(function(event) {
|
||||||
if (!settingsOverlay.deleteDirPressedAgain) {
|
if (!settings.deleteDirPressedAgain) {
|
||||||
settingsOverlay.deleteDirPressedAgain = true;
|
settings.deleteDirPressedAgain = true;
|
||||||
deleteDirButton.setText("Подтвердить вменяемость");
|
deleteDirButton.setText("Подтвердить");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete dir!
|
// Delete dir!
|
||||||
settingsOverlay.deleteUpdatesDir();
|
settings.deleteUpdatesDir();
|
||||||
settingsOverlay.deleteDirPressedAgain = false;
|
settings.deleteDirPressedAgain = false;
|
||||||
deleteDirButton.setText("Ещё раз попробовать");
|
settings.count = settings.count+1;
|
||||||
|
if(settings.count>9){
|
||||||
|
javafx.application.Platform.exit();
|
||||||
|
}
|
||||||
|
deleteDirButton.setText(
|
||||||
|
settings.count>8?"Прощай :(":
|
||||||
|
(settings.count>7?"Я умираю!":
|
||||||
|
(settings.count>5?"DeathCry, спаси!":
|
||||||
|
(settings.count>4?"Умоляю, перестань!":
|
||||||
|
(settings.count>3?"Да хорош уже!":"Ещё раз")
|
||||||
|
))));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Lookup debug checkbox
|
// Lookup debug checkbox
|
||||||
|
@ -109,8 +120,9 @@ var settingsOverlay = {
|
||||||
debugBox.selectedProperty()["addListener(javafx.beans.value.ChangeListener)"](
|
debugBox.selectedProperty()["addListener(javafx.beans.value.ChangeListener)"](
|
||||||
function(o, ov, nv) LogHelper.setDebugEnabled(nv));
|
function(o, ov, nv) LogHelper.setDebugEnabled(nv));
|
||||||
|
|
||||||
|
|
||||||
// Lookup apply settings button
|
// Lookup apply settings button
|
||||||
settingsOverlay.overlay.lookup("#apply").setOnAction(function(event) overlay.hide(0, null));
|
holder.lookup("#apply").setOnAction(function(event) overlay.hide(0, null));
|
||||||
},
|
},
|
||||||
|
|
||||||
updateRAMLabel: function() {
|
updateRAMLabel: function() {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#overlay > #utitle {
|
#overlay > #utitle {
|
||||||
-fx-font-size: 14pt;
|
-fx-alignment: top-left;
|
||||||
-fx-alignment: baseline-center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#overlay > #description {
|
#overlay > #description {
|
||||||
|
@ -13,19 +12,29 @@ #overlay > #description.error {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Progress bar */
|
/* Progress bar */
|
||||||
#overlay > #progress {
|
.progress-bar {
|
||||||
-fx-indeterminate-bar-flip: false;
|
-fx-indeterminate-bar-flip: false;
|
||||||
|
-fx-background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overlay > #progress > .bar {
|
.progress-indicator{
|
||||||
-fx-background-color: #888888;
|
-fx-background-color: transparent ;
|
||||||
-fx-background-insets: none;
|
}
|
||||||
-fx-background-radius: 3px;
|
|
||||||
|
.progress-indicator .indicator {
|
||||||
|
-fx-background-color: transparent ;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-bar > .bar {
|
||||||
|
-fx-background-image: url("../../images/downloader/cl_line.png");
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-background-insets: 0;
|
||||||
|
-fx-background-radius: 0;
|
||||||
-fx-padding: 0;
|
-fx-padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overlay > #progress > .track {
|
.progress-bar > .track {
|
||||||
-fx-background-color: #E6E6E6;
|
-fx-background-color: transparent;
|
||||||
-fx-background-insets: none;
|
-fx-background-insets: 0;
|
||||||
-fx-background-radius: 3px;
|
-fx-background-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,15 +3,35 @@
|
||||||
<?import java.net.URL?>
|
<?import java.net.URL?>
|
||||||
<?import javafx.scene.control.Label?>
|
<?import javafx.scene.control.Label?>
|
||||||
<?import javafx.scene.control.ProgressBar?>
|
<?import javafx.scene.control.ProgressBar?>
|
||||||
|
<?import javafx.scene.image.Image?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
<?import javafx.scene.layout.Pane?>
|
<?import javafx.scene.layout.Pane?>
|
||||||
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
<Pane xmlns:fx="http://javafx.com/fxml/1" fx:id="overlay" prefWidth="500.0" prefHeight="250.0">
|
<!-- DrLeonardo Design -->
|
||||||
|
|
||||||
|
<Pane fx:id="overlay" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
|
<children>
|
||||||
|
<ImageView fitHeight="400.0" fitWidth="600.0" pickOnBounds="true" preserveRatio="true">
|
||||||
|
<image>
|
||||||
|
<Image url="@../../images/downloader/background.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<Label fx:id="description" layoutX="12.0" layoutY="267.0" prefHeight="98.0" prefWidth="576.0" text="..." textFill="WHITE" />
|
||||||
|
<ProgressBar fx:id="progress" disable="false" layoutX="-1.0" layoutY="376.0" opacity="1.0" prefHeight="24.0" prefWidth="600.0" progress="1.0" style="" />
|
||||||
|
<!-- Update controls -->
|
||||||
|
<Label fx:id="utitle" alignment="TOP_LEFT" layoutX="15.0" layoutY="236.0" prefHeight="30.0" prefWidth="470.0" text="Обновление..." textFill="WHITE">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="20.0" />
|
||||||
|
</font>
|
||||||
|
</Label>
|
||||||
|
<ImageView fitHeight="160.0" fitWidth="160.0" layoutX="219.0" layoutY="70.0" y="-6.0">
|
||||||
|
<image>
|
||||||
|
<Image url="@../../images/icons/loading.gif" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
</children>
|
||||||
<stylesheets>
|
<stylesheets>
|
||||||
<URL value="@update.css" />
|
<URL value="@update.css" />
|
||||||
</stylesheets>
|
</stylesheets>
|
||||||
|
|
||||||
<!-- Update controls -->
|
|
||||||
<Label fx:id="utitle" layoutX="10.0" layoutY="10.0" prefWidth="480.0" text="Обновление" />
|
|
||||||
<Label fx:id="description" layoutX="10.0" layoutY="50.0" prefWidth="480.0" prefHeight="165.0" text="..." />
|
|
||||||
<ProgressBar fx:id="progress" layoutX="10.0" layoutY="220.0" prefWidth="480.0" prefHeight="20.0" />
|
|
||||||
</Pane>
|
</Pane>
|
||||||
|
|
|
@ -35,7 +35,6 @@ var update = {
|
||||||
var estimatedSS = (estimatedSeconds % 60) | 0;
|
var estimatedSS = (estimatedSeconds % 60) | 0;
|
||||||
task.updateMessage(java.lang.String.format(
|
task.updateMessage(java.lang.String.format(
|
||||||
"Файл: %s%n" + // File line
|
"Файл: %s%n" + // File line
|
||||||
"Загружено (Файл): %.2f / %.2f MiB.%n" + // File downloaded line
|
|
||||||
"Загружено (Всего): %.2f / %.2f MiB.%n" + // Total downloaded line
|
"Загружено (Всего): %.2f / %.2f MiB.%n" + // Total downloaded line
|
||||||
"%n" +
|
"%n" +
|
||||||
"Средняя скорость: %.1f Kbps%n" + // Speed line
|
"Средняя скорость: %.1f Kbps%n" + // Speed line
|
||||||
|
@ -43,7 +42,6 @@ var update = {
|
||||||
|
|
||||||
// Formatting
|
// Formatting
|
||||||
state.filePath, // File path
|
state.filePath, // File path
|
||||||
state.getFileDownloadedMiB() + /* Fuck nashorn */ 0.0, state.getFileSizeMiB() + 0.0, // File downloaded
|
|
||||||
state.getTotalDownloadedMiB() + /* Fuck nashorn */ 0.0, state.getTotalSizeMiB() + 0.0, // Total downloaded
|
state.getTotalDownloadedMiB() + /* Fuck nashorn */ 0.0, state.getTotalSizeMiB() + 0.0, // Total downloaded
|
||||||
bps <= 0.0 ? 0.0 : bps / 1024.0, // Speed
|
bps <= 0.0 ? 0.0 : bps / 1024.0, // Speed
|
||||||
estimatedHH, estimatedMM, estimatedSS // Estimated (hh:mm:ss)
|
estimatedHH, estimatedMM, estimatedSS // Estimated (hh:mm:ss)
|
||||||
|
@ -71,11 +69,25 @@ var update = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function offlineUpdateRequest(dirName, dir, matcher, digest) {
|
||||||
|
return function() {
|
||||||
|
var hdir = settings.lastHDirs.get(dirName);
|
||||||
|
if (hdir === null) {
|
||||||
|
Request.requestError(java.lang.String.format("Директории '%s' нет в кэше", dirName));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify dir with matcher using ClientLauncher's API
|
||||||
|
ClientLauncher.verifyHDir(dir, hdir.object, matcher, digest);
|
||||||
|
return hdir;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/* Export functions */
|
/* Export functions */
|
||||||
function makeUpdateRequest(dirName, dir, matcher, digest, callback) {
|
function makeUpdateRequest(dirName, dir, matcher, digest, callback) {
|
||||||
var request = settings.offline ? { setStateCallback: function(stateCallback) { /* Ignored */ } } :
|
var request = settings.offline ? { setStateCallback: function(stateCallback) { /* Ignored */ } } :
|
||||||
new UpdateRequest(dirName, dir, matcher, digest);
|
new UpdateRequest(dirName, dir, matcher, digest);
|
||||||
var task = settings.offline ? newTask(FunctionalBridge.offlineUpdateRequest(dirName, dir, settings.lastHDirs.get(dirName), matcher, digest)) :
|
var task = settings.offline ? newTask(offlineUpdateRequest(dirName, dir, matcher, digest)) :
|
||||||
newRequestTask(request);
|
newRequestTask(request);
|
||||||
|
|
||||||
// Set task properties and start
|
// Set task properties and start
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
* {
|
|
||||||
-fx-font-family: 'Open Sans', sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
#cellBox {
|
|
||||||
-fx-alignment: center-left;
|
|
||||||
-fx-padding: 0 5px 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#cellBox > #profileTitle {
|
|
||||||
-fx-text-fill: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
#cellBox > #serverStatus {
|
|
||||||
-fx-text-fill: black;
|
|
||||||
-fx-font-size: 9px;
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<?import java.net.URL?>
|
|
||||||
<?import javafx.scene.control.Label?>
|
|
||||||
<?import javafx.scene.layout.HBox?>
|
|
||||||
<?import javafx.scene.layout.Pane?>
|
|
||||||
<?import javafx.scene.shape.Circle?>
|
|
||||||
|
|
||||||
<HBox xmlns:fx="http://javafx.com/fxml/1" fx:id="cellBox">
|
|
||||||
<stylesheets>
|
|
||||||
<URL value="@profileCell.css" />
|
|
||||||
</stylesheets>
|
|
||||||
|
|
||||||
<!-- Left side -->
|
|
||||||
<Label fx:id="profileTitle">
|
|
||||||
<graphic><Circle radius="3.0" /></graphic>
|
|
||||||
</Label>
|
|
||||||
|
|
||||||
<!-- Separator -->
|
|
||||||
<Pane HBox.hgrow="ALWAYS" />
|
|
||||||
|
|
||||||
<!-- Right side -->
|
|
||||||
<Label fx:id="serverStatus" />
|
|
||||||
</HBox>
|
|
Before Width: | Height: | Size: 290 B |
|
@ -1,34 +0,0 @@
|
||||||
.button {
|
|
||||||
-fx-background-color: #E0E1E2;
|
|
||||||
-fx-background-radius: 3px;
|
|
||||||
-fx-background-insets: none;
|
|
||||||
|
|
||||||
/* Text settings */
|
|
||||||
-fx-text-fill: rgba(0,0,0,.8);
|
|
||||||
-fx-font-size: 9pt;
|
|
||||||
-fx-font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button:hover,
|
|
||||||
.button:focused {
|
|
||||||
-fx-background-color: #CACBCD;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button:pressed {
|
|
||||||
-fx-background-color: #BABBBC;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Default button */
|
|
||||||
.button:default {
|
|
||||||
-fx-background-color: #2185D0;
|
|
||||||
-fx-text-fill: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button:default:hover,
|
|
||||||
.button:default:focused {
|
|
||||||
-fx-background-color: #1678C2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button:default:pressed {
|
|
||||||
-fx-background-color: #1A69A4;
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
@import url(button.css);
|
|
||||||
@import url(input.css);
|
|
||||||
|
|
||||||
/* Common styles */
|
|
||||||
* {
|
|
||||||
-fx-font-family: "Open Sans", sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
Button, CheckBox, ComboBox {
|
|
||||||
-fx-cursor: hand;
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
.text-input,
|
|
||||||
.check-box > .box,
|
|
||||||
.combo-box-base,
|
|
||||||
.combo-box-popup > .list-view {
|
|
||||||
-fx-background-color: rgba(34,36,38,.15), white;
|
|
||||||
-fx-background-insets: 0, 1;
|
|
||||||
-fx-background-radius: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-input:focused,
|
|
||||||
.check-box:hover > .box,
|
|
||||||
.check-box:focused > .box,
|
|
||||||
.combo-box-base:hover,
|
|
||||||
.combo-box-base:focused,
|
|
||||||
.combo-box-base:showing {
|
|
||||||
-fx-background-color: rgba(34,36,38,.35), white;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Combobox-specific */
|
|
||||||
.combo-box-popup > .list-view > .virtual-flow > .clipped-container > .sheet > .list-cell {
|
|
||||||
-fx-background-color: white;
|
|
||||||
-fx-text-fill: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
.combo-box-popup > .list-view > .virtual-flow > .clipped-container > .sheet > .list-cell:filled:hover {
|
|
||||||
-fx-background-color: #EFEFEF;
|
|
||||||
}
|
|
|
@ -25,6 +25,7 @@ var CheckServerRequest = CheckServerRequestClass.static;
|
||||||
var UpdateRequest = UpdateRequestClass.static;
|
var UpdateRequest = UpdateRequestClass.static;
|
||||||
var LauncherRequest = LauncherRequestClass.static;
|
var LauncherRequest = LauncherRequestClass.static;
|
||||||
var ProfilesRequest = ProfilesRequestClass.static;
|
var ProfilesRequest = ProfilesRequestClass.static;
|
||||||
|
var SetProfileRequest = SetProfileRequestClass.static;
|
||||||
var ProfileByUsernameRequest = ProfileByUsernameRequestClass.static;
|
var ProfileByUsernameRequest = ProfileByUsernameRequestClass.static;
|
||||||
var ProfileByUUIDRequest = ProfileByUUIDRequestClass.static;
|
var ProfileByUUIDRequest = ProfileByUUIDRequestClass.static;
|
||||||
var BatchProfileByUsernameRequest = BatchProfileByUsernameRequestClass.static;
|
var BatchProfileByUsernameRequest = BatchProfileByUsernameRequestClass.static;
|
||||||
|
|
BIN
Launcher/runtime/favicon.ico
Normal file
After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 4.7 KiB |
|
@ -1,4 +1,12 @@
|
||||||
var app, stage, scene;
|
var app, stage, scene, loginScene, menuScene;
|
||||||
|
|
||||||
|
var rootPane, loginPane, authPane, menuPane;
|
||||||
|
launcher.loadScript("servers.js");
|
||||||
|
|
||||||
|
// internal
|
||||||
|
function getPathDirHelper() {
|
||||||
|
return dir;
|
||||||
|
}
|
||||||
|
|
||||||
// Override application class
|
// Override application class
|
||||||
var LauncherApp = Java.extend(JSApplication, {
|
var LauncherApp = Java.extend(JSApplication, {
|
||||||
|
@ -6,34 +14,37 @@ var LauncherApp = Java.extend(JSApplication, {
|
||||||
app = JSApplication.getInstance();
|
app = JSApplication.getInstance();
|
||||||
cliParams.init(app.getParameters());
|
cliParams.init(app.getParameters());
|
||||||
settings.load();
|
settings.load();
|
||||||
|
options.load();
|
||||||
cliParams.applySettings();
|
cliParams.applySettings();
|
||||||
}, start: function(primaryStage) {
|
}, start: function(primaryStage) {
|
||||||
stage = primaryStage;
|
stage = primaryStage;
|
||||||
|
stage.initStyle(javafx.stage.StageStyle.TRANSPARENT);
|
||||||
|
stage.setResizable(false);
|
||||||
stage.setTitle(config.title);
|
stage.setTitle(config.title);
|
||||||
|
|
||||||
// Disable resizable button
|
|
||||||
stage.setResizable(false);
|
|
||||||
|
|
||||||
// Set icons
|
// Set icons
|
||||||
for each (var icon in config.icons) {
|
config.icons.forEach(function(icon) {
|
||||||
var iconURL = Launcher.getResourceURL(icon).toString();
|
var iconURL = Launcher.getResourceURL(icon).toString();
|
||||||
stage.getIcons().add(new javafx.scene.image.Image(iconURL));
|
stage.getIcons().add(new javafx.scene.image.Image(iconURL));
|
||||||
}
|
});
|
||||||
|
|
||||||
// Load dialog FXML
|
// Load launcher FXML
|
||||||
rootPane = loadFXML("dialog/dialog.fxml");
|
loginPane = loadFXML("dialog/login.fxml");
|
||||||
initDialog();
|
menuPane = loadFXML("dialog/mainmenu.fxml");
|
||||||
|
|
||||||
// Set scene
|
loginScene = new javafx.scene.Scene(loginPane);
|
||||||
scene = new javafx.scene.Scene(rootPane);
|
loginScene.setFill(javafx.scene.paint.Color.TRANSPARENT);
|
||||||
stage.setScene(scene);
|
|
||||||
|
menuScene = new javafx.scene.Scene(menuPane);
|
||||||
|
menuScene.setFill(javafx.scene.paint.Color.TRANSPARENT);
|
||||||
|
|
||||||
|
setCurrentScene(loginScene);
|
||||||
|
|
||||||
|
initLauncher();
|
||||||
|
|
||||||
// Center and show stage
|
|
||||||
stage.sizeToScene();
|
|
||||||
stage.centerOnScreen();
|
|
||||||
stage.show();
|
|
||||||
}, stop: function() {
|
}, stop: function() {
|
||||||
settings.save();
|
settings.save();
|
||||||
|
options.save();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -44,18 +55,28 @@ function loadFXML(name) {
|
||||||
return loader.load();
|
return loader.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setCurrentScene(scene) {
|
||||||
|
stage.setScene(scene);
|
||||||
|
rootPane = scene.getRoot();
|
||||||
|
dimPane = rootPane.lookup("#mask");
|
||||||
|
stage.sizeToScene();
|
||||||
|
stage.centerOnScreen();
|
||||||
|
stage.show();
|
||||||
|
}
|
||||||
|
|
||||||
function setRootParent(parent) {
|
function setRootParent(parent) {
|
||||||
scene.setRoot(parent);
|
scene.setRoot(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start function - there all begins
|
// Start function - there all begins
|
||||||
function start(args) {
|
function start(args) {
|
||||||
|
|
||||||
// Set font rendering properties
|
// Set font rendering properties
|
||||||
LogHelper.debug("Setting FX properties");
|
LogHelper.debug("Setting FX properties");
|
||||||
java.lang.System.setProperty("prism.lcdtext", "false");
|
java.lang.System.setProperty("prism.lcdtext", "false");
|
||||||
|
|
||||||
// Start laucher JavaFX stage
|
// Start laucher JavaFX stage
|
||||||
LogHelper.debug("Launching JavaFX application");
|
LogHelper.debug("Launching JavaFX application");
|
||||||
javafx.application.Application.launch(LauncherApp.class, args);
|
javafx.application.Application.launch(LauncherApp.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
launcher.loadScript("dialog/dialog.js");
|
launcher.loadScript("dialog/dialog.js");
|
14
Launcher/runtime/servers.js
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
// ====== SERVERS CONFIG ====== //
|
||||||
|
var serversConfig = {
|
||||||
|
defaults: {
|
||||||
|
// Лозунг сервера
|
||||||
|
description: "Мир в котором возможно все"
|
||||||
|
},
|
||||||
|
|
||||||
|
getServerProperty: function(profile, property){
|
||||||
|
if(serversConfig[profile]==null || serversConfig[profile][property]==null){
|
||||||
|
return serversConfig.defaults[property];
|
||||||
|
}
|
||||||
|
return serversConfig[profile][property];
|
||||||
|
}
|
||||||
|
};
|