Merge branch 'dev' of github.com:GravitLauncher/Launcher into

dev
This commit is contained in:
Zaxar163 2019-08-16 12:49:58 +03:00
commit 100b0fcda0
27 changed files with 580 additions and 429 deletions

View file

@ -39,7 +39,6 @@
dependencies {
pack project(':LauncherAuthlib')
bundle 'com.github.oshi:oshi-core:3.13.0'
bundle 'de.jensd:fontawesomefx:8.9'
bundle 'org.apache.httpcomponents:httpclient:4.5.7'
pack 'io.netty:netty-codec-http:4.1.36.Final'
pack 'org.ow2.asm:asm-tree:7.1'

View file

@ -2,7 +2,7 @@
var config = {
dir: "GravitLauncher", // Launcher directory
title: "GravitLauncher", // Window title
icons: [ "favicon.png" ], // Window icon paths
icons: ["favicon.png"], // Window icon paths
// Auth config
linkText: "GravitLauncher", // Text for link under "Auth" button

View file

@ -24,9 +24,9 @@ function initLauncher() {
/* ======== init Login window======== */
function initLoginScene() {
loginPane.setOnMousePressed(function(event){ movePoint = new javafx.geometry.Point2D(event.getSceneX(), event.getSceneY())});
loginPane.setOnMousePressed(function(event) { movePoint = new javafx.geometry.Point2D(event.getSceneX(), event.getSceneY()) });
loginPane.setOnMouseDragged(function(event) {
if(movePoint === null) {
if (movePoint === null) {
return;
}
stage.setX(event.getScreenX() - movePoint.getX());
@ -35,9 +35,9 @@ function initLoginScene() {
var pane = loginPane.lookup("#bar");
bar = pane;
loginPane.lookup("#close").setOnAction(function(event){ javafx.application.Platform.exit()});
loginPane.lookup("#hide").setOnAction(function(event){ stage.setIconified(true)});
loginPane.lookup("#discord").setOnAction(function(){ openURL(config.discord); });
loginPane.lookup("#close").setOnAction(function(event) { javafx.application.Platform.exit() });
loginPane.lookup("#hide").setOnAction(function(event) { stage.setIconified(true) });
loginPane.lookup("#discord").setOnAction(function() { openURL(config.discord); });
var pane = loginPane.lookup("#authPane");
authPane = pane;
@ -46,14 +46,14 @@ function initLoginScene() {
loginPaneLayout = loginLayout;
loginField = pane.lookup("#login");
loginField.setOnMouseMoved(function(event){rootPane.fireEvent(event)});
loginField.setOnMouseMoved(function(event) { rootPane.fireEvent(event) });
loginField.setOnAction(goAuth);
if (settings.login !== null) {
loginField.setText(settings.login);
}
passwordField = pane.lookup("#password");
passwordField.setOnMouseMoved(function(event){rootPane.fireEvent(event)});
passwordField.setOnMouseMoved(function(event) { rootPane.fireEvent(event) });
passwordField.setOnAction(goAuth);
if (settings.rsaPassword !== null) {
passwordField.getStyleClass().add("hasSaved");
@ -74,9 +74,9 @@ function initLoginScene() {
/* ======== init Menu window======== */
function initMenuScene() {
menuPane.setOnMousePressed(function(event){ movePoint = new javafx.geometry.Point2D(event.getSceneX(), event.getSceneY())});
menuPane.setOnMousePressed(function(event) { movePoint = new javafx.geometry.Point2D(event.getSceneX(), event.getSceneY()) });
menuPane.setOnMouseDragged(function(event) {
if(movePoint === null) {
if (movePoint === null) {
return;
}
@ -86,9 +86,9 @@ function initMenuScene() {
var pane = menuPane.lookup("#bar");
bar = pane;
pane.lookup("#close").setOnAction(function(event){ javafx.application.Platform.exit()});
pane.lookup("#hide").setOnAction(function(event){ stage.setIconified(true)});
pane.lookup("#discord").setOnAction(function(){ openURL(config.discord); });
pane.lookup("#close").setOnAction(function(event) { javafx.application.Platform.exit() });
pane.lookup("#hide").setOnAction(function(event) { stage.setIconified(true) });
pane.lookup("#discord").setOnAction(function() { openURL(config.discord); });
pane.lookup("#settings").setOnAction(goSettings);
pane.lookup("#goConsole").setOnAction(goConsole);
@ -105,10 +105,10 @@ function initMenuScene() {
serverEntrance = pane.lookup("#serverentrance");
serverStatus = serverEntrance.lookup("#serverStatus");
serverLabel = serverEntrance.lookup("#serverLabel");
serverEntrance.lookup("#clientLaunch").setOnAction(function(){
serverEntrance.lookup("#clientLaunch").setOnAction(function() {
doUpdate(profilesList[serverHolder.old], loginData.pp, loginData.accessToken);
});
pane.lookup("#logout").setOnAction(function(){
pane.lookup("#logout").setOnAction(function() {
setCurrentScene(loginScene);
});
@ -116,9 +116,9 @@ function initMenuScene() {
/* ======== init Console window======== */
function initConsoleScene() {
consoleMenu.setOnMousePressed(function(event){ movePoint = new javafx.geometry.Point2D(event.getSceneX(), event.getSceneY())});
consoleMenu.setOnMousePressed(function(event) { movePoint = new javafx.geometry.Point2D(event.getSceneX(), event.getSceneY()) });
consoleMenu.setOnMouseDragged(function(event) {
if(movePoint === null) {
if (movePoint === null) {
return;
}
@ -128,21 +128,21 @@ function initConsoleScene() {
var pane = consoleMenu.lookup("#bar");
consoleBar = pane;
pane.lookup("#close").setOnAction(function(){
pane.lookup("#close").setOnAction(function() {
consoleStage.hide();
});
var text = consoleMenu.lookup("#textField");
var output = consoleMenu.lookup("#output");
var appendFunction = function(line) javafx.application.Platform.runLater(function() output.appendText(line));
consoleMenu.lookup("#send").setOnAction(function(){
consoleMenu.lookup("#send").setOnAction(function() {
execCommand(text.getText());
if (text.getText() == "clear") {
output.setText("");
}
if (text.getText() == "clear") {
output.setText("");
}
text.setText("");
});
FunctionalBridge.addPlainOutput(function(string) {
appendFunction(string+"\n");
appendFunction(string + "\n");
})
pane.lookup("#hide").setOnAction(function(event) { consoleStage.setIconified(true) });
@ -153,9 +153,9 @@ function initConsoleScene() {
/* ======== init Options window======== */
function initOptionsScene() {
optionsMenu.setOnMousePressed(function(event){ movePoint = new javafx.geometry.Point2D(event.getSceneX(), event.getSceneY())});
optionsMenu.setOnMousePressed(function(event) { movePoint = new javafx.geometry.Point2D(event.getSceneX(), event.getSceneY()) });
optionsMenu.setOnMouseDragged(function(event) {
if(movePoint === null) {
if (movePoint === null) {
return;
}
@ -165,9 +165,9 @@ function initOptionsScene() {
var pane = optionsMenu.lookup("#bar");
bar = pane;
pane.lookup("#close").setOnAction(function(event){ javafx.application.Platform.exit()});
pane.lookup("#hide").setOnAction(function(event){ stage.setIconified(true)});
pane.lookup("#back").setOnAction(function(){
pane.lookup("#close").setOnAction(function(event) { javafx.application.Platform.exit() });
pane.lookup("#hide").setOnAction(function(event) { stage.setIconified(true) });
pane.lookup("#back").setOnAction(function() {
setCurrentScene(menuScene);
});
}
@ -202,29 +202,29 @@ function goAuth(event) {
return; // No auth selected
}
var rsaPassword = null;
var auth = authOptions.getSelectionModel().getSelectedItem();
if (auth === null) {
var rsaPassword = null;
var auth = authOptions.getSelectionModel().getSelectedItem();
if (auth === null) {
return;
}
if (!passwordField.isDisable()) {
var password = passwordField.getText();
if (password !== null && !password.isEmpty()) {
rsaPassword = settingsOverlay.setPassword(password);
} else if (settings.rsaPassword !== null) {
rsaPassword = settings.rsaPassword;
} else {
return;
}
}
if (!passwordField.isDisable()) {
var password = passwordField.getText();
if (password !== null && !password.isEmpty()) {
rsaPassword = settingsOverlay.setPassword(password);
} else if (settings.rsaPassword !== null) {
rsaPassword = settings.rsaPassword;
} else {
return;
}
settings.rsaPassword = savePasswordBox.isSelected() ? rsaPassword : null;
}
settings.rsaPassword = savePasswordBox.isSelected() ? rsaPassword : null;
}
settings.login = login;
doAuth(login, rsaPassword, authTypes[auth]);
}
settings.login = login;
doAuth(login, rsaPassword, authTypes[auth]);
}
/* ======== Console ======== */
/* ======== Console ======== */
function goConsole(event) {
setConsoleCurrentScene(consoleScene);
}
@ -267,7 +267,7 @@ function verifyLauncher(e) {
authOptions.getSelectionModel().select(0);
var sm = authOptions.getSelectionModel().selectedIndexProperty();
sm.addListener(new javafx.beans.value.ChangeListener({
changed: function (observableValue, oldSelection, newSelection) {
changed: function(observableValue, oldSelection, newSelection) {
settings.auth = authTypes[authOptions.getSelectionModel().getSelectedItem()];
}
}));
@ -287,14 +287,18 @@ function verifyLauncher(e) {
function doAuth(login, rsaPassword, auth_type) {
processing.resetOverlay();
overlay.show(processing.overlay, function (event) {
overlay.show(processing.overlay, function(event) {
FunctionalBridge.getHWID.join();
makeAuthRequest(login, rsaPassword, auth_type, function (result) {
makeAuthRequest(login, rsaPassword, auth_type, function(result) {
FunctionalBridge.setAuthParams(result);
loginData = { pp: result.playerProfile , accessToken: result.accessToken, permissions: result.permissions,
auth_type: settings.auth};
loginData = {
pp: result.playerProfile,
accessToken: result.accessToken,
permissions: result.permissions,
auth_type: settings.auth
};
overlay.hide(0, function () {
overlay.hide(0, function() {
setCurrentScene(menuScene);
});
return result;
@ -355,10 +359,8 @@ function doUpdate(profile, pp, accessToken) {
function doLaunchClient(assetDir, assetHDir, clientDir, clientHDir, profile, pp, accessToken) {
processing.resetOverlay();
overlay.swap(0, processing.overlay, function(event)
launchClient(assetHDir, clientHDir, profile, new ClientLauncherParams(settings.lastDigest,
assetDir, clientDir, pp, accessToken, settings.autoEnter, settings.fullScreen, settings.ram, 0, 0), doDebugClient)
);
overlay.swap(0, processing.overlay, function(event) launchClient(assetHDir, clientHDir, profile, new ClientLauncherParams(settings.lastDigest,
assetDir, clientDir, pp, accessToken, settings.autoEnter, settings.fullScreen, settings.ram, 0, 0), doDebugClient));
}
function doDebugClient(process) {
@ -398,10 +400,10 @@ function updateProfilesList(profiles) {
if (profile.getOptional() != null) profile.updateOptionalGraph();
index++;
});
LogHelper.debug("Load selected %d profile",settings.profile);
if(profiles.length > 0) {
if(settings.profile >= profiles.length)
settings.profile = profiles.length-1;
LogHelper.debug("Load selected %d profile", settings.profile);
if (profiles.length > 0) {
if (settings.profile >= profiles.length)
settings.profile = profiles.length - 1;
serverHolder.set(serverList.getChildren().get(settings.profile));
}
}
@ -412,11 +414,11 @@ function pingServer(btn) {
var task = newTask(function() pingers[profile].ping());
task.setOnSucceeded(function(event) {
var result = task.getValue();
if(btn==serverHolder.old){
if (btn == serverHolder.old) {
setServerStatus(java.lang.String.format("%d из %d", result.onlinePlayers, result.maxPlayers));
}
});
task.setOnFailed(function(event){ if(btn==serverHolder.old){setServerStatus("Недоступен")}});
task.setOnFailed(function(event) { if (btn == serverHolder.old) { setServerStatus("Недоступен") } });
startTask(task);
}
@ -482,7 +484,7 @@ var overlay = {
fade(overlay.current, delay, 1.0, 0.0, function(event) {
dimPane.requestFocus();
if(overlay.current==null){
if (overlay.current == null) {
overlay.show(newOverlay, onFinished);
return;
}
@ -504,13 +506,13 @@ var overlay = {
var serverHolder = {
old: null,
set: function(btn){
set: function(btn) {
pingServer(btn);
serverLabel.setText(profilesList[btn]);
serverDescription.setText(profilesList[btn].info);
btn.setSelected(true);
btn.setDisable(true);
if(serverHolder.old!=null){
if (serverHolder.old != null) {
serverHolder.old.setSelected(false);
serverHolder.old.setDisable(false);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -4,23 +4,23 @@ Button {
}
/* Outputs */
#overlay > #output,
#background > #output {
#overlay>#output,
#background>#output {
-fx-background-color: white;
-fx-background-radius: 0;
-fx-font-family: monospace;
-fx-font-size: 8pt;
}
#overlay > #output .content,
#background > #output .content {
#overlay>#output .content,
#background>#output .content {
-fx-background-color: white;
-fx-background-radius: 0;
}
/* Close button */
#overlay > #copy,
#overlay > #action.close {
#overlay>#copy,
#overlay>#action.close {
-fx-background-radius: 0;
-fx-text-fill: white;
-fx-background-position: center;
@ -29,17 +29,17 @@ #overlay > #action.close {
-fx-pref-height: 25px;
}
#overlay > #copy:hover,
#overlay > #copy:focused,
#overlay > #action.close:hover,
#overlay > #action.close:focused,
#overlay > #copy:pressed,
#overlay > #action.close:pressed {
#overlay>#copy:hover,
#overlay>#copy:focused,
#overlay>#action.close:hover,
#overlay>#action.close:focused,
#overlay>#copy:pressed,
#overlay>#action.close:pressed {
-fx-background-color: #1568ce;
}
/* Kill button */
#overlay > #action.kill {
#overlay>#action.kill {
-fx-background-radius: 0;
-fx-text-fill: white;
-fx-background-position: center;
@ -48,9 +48,10 @@ #overlay > #action.kill {
-fx-pref-height: 25px;
}
#overlay > #action.kill:hover,
#overlay > #action.kill:focused,
#overlay > #action.kill:pressed {
#overlay>#action.kill:hover,
#overlay>#action.kill:focused,
#overlay>#action.kill:pressed {
-fx-background-color: #DB5252;
}
/*-- DrLeonardo Design --*/

View file

@ -1,10 +1,13 @@
var debug = {
overlay: null, output: null, action: null, process: null,
overlay: null,
output: null,
action: null,
process: null,
initOverlay: function() {
debug.overlay = loadFXML("dialog/overlay/debug/debug.fxml");
debug.overlay.lookup("#version").setText(
debug.overlay.lookup("#version").setText(
java.lang.String.format(
"%s | Java %s x%s",
FunctionalBridge.getLauncherVersion(),
@ -22,7 +25,7 @@ var debug = {
content.putString(debug.output.getText());
javafx.scene.input.Clipboard.getSystemClipboard().
setContent(content);
setContent(content);
});
debug.action = debug.overlay.lookup("#action");
@ -47,8 +50,7 @@ var debug = {
append: function(text) {
//Experimental Feature
if(debug.output.getText().length() > 32000 /* Max length */)
{
if (debug.output.getText().length() > 32000 /* Max length */ ) {
debug.output.deleteText(0, text.length());
}
debug.output.appendText(text);
@ -79,7 +81,7 @@ function debugProcess(process) {
var reader = IOHelper.newReader(process.getInputStream(),
java.nio.charset.Charset.defaultCharset());
var appendFunction = function(line)
javafx.application.Platform.runLater(function() debug.append(line));
javafx.application.Platform.runLater(function() debug.append(line));
for (var length = reader.read(buffer); length >= 0; length = reader.read(buffer)) {
appendFunction(new java.lang.String(buffer, 0, length));
}

View file

@ -1,11 +1,12 @@
/*-- DrLeonardo Design --*/
#overlay > #description {
#overlay>#description {
-fx-font-size: 12pt;
-fx-text-fill: #fff;
-fx-wrap-text: true;
}
#overlay > #description.error {
#overlay>#description.error {
-fx-text-fill: red;
}
/*-- DrLeonardo Design --*/

View file

@ -1,6 +1,9 @@
var processing = {
overlay: null, spinner: null, description: null,
processingImage: null, errorImage: null,
overlay: null,
spinner: null,
description: null,
processingImage: null,
errorImage: null,
initOverlay: function() {
processing.overlay = loadFXML("dialog/overlay/processing/processing.fxml");
@ -69,6 +72,7 @@ function makeLauncherRequest(callback) {
task.updateMessage("Обновление лаунчера");
startTask(task);
}
function makeProfilesRequest(callback) {
var task = newRequestTask(new ProfilesRequest());
@ -83,6 +87,7 @@ function makeProfilesRequest(callback) {
task.updateMessage("Обновление профилей");
startTask(task);
}
function makeAuthAvailabilityRequest(callback) {
var task = newRequestTask(new GetAvailabilityAuthRequest());
@ -98,6 +103,7 @@ function makeAuthAvailabilityRequest(callback) {
task.updateMessage("Обновление способов авторизации");
startTask(task);
}
function makeSetProfileRequest(profile, callback) {
var task = newRequestTask(new SetProfileRequest(profile));

View file

@ -1,14 +1,19 @@
/*-- DrLeonardo Design --*/
#holder {
-fx-background-color: #fff;
-fx-background-color: #fff;
}
#holder > #transferDialog {
#holder>#transferDialog {
-fx-background-color: rgba(0, 0, 0, 0.5);
-fx-pref-width: 694px;
-fx-pref-height: 425px;
}
/* Labels */
#holder > #settingsTitle {
#holder>#settingsTitle {
-fx-font-size: 14pt;
-fx-alignment: baseline-center;
}
@ -19,30 +24,35 @@ #holder #dirChange {
-fx-font-weight: bold;
}
/* RAM slider */
#holder > #ramSlider > .track {
#holder>#ramSlider>.track {
-fx-background-color: #909090;
}
#holder > #ramSlider > .thumb {
#holder>#ramSlider>.thumb {
-fx-background-color: #5fd97a;
}
#holder > #ramSlider > .colored-track {
#holder>#ramSlider>.colored-track {
-fx-background-color: #5fd97a;
}
#holder > #ramSlider > .animated-thumb {
#holder>#ramSlider>.animated-thumb {
-fx-background-color: #5fd97a;
}
#holder > #ramSlider > .slider-value {
#holder>#ramSlider>.slider-value {
-fx-fill: white;
-fx-stroke: white;
}
/* Dir options */
#holder > #deleteDir, #cancelTransfer {
#holder>#deleteDir,
#cancelTransfer {
-fx-background-radius: 0;
-fx-text-fill: white;
-fx-background-position: center;
@ -51,23 +61,26 @@ #holder > #deleteDir, #cancelTransfer {
-fx-pref-height: 25px;
}
#holder > #deleteDir:hover,#cancelTransfer:hover,
#holder > #deleteDir:focused,#cancelTransfer:focused {
#holder>#deleteDir:hover,
#cancelTransfer:hover,
#holder>#deleteDir:focused,
#cancelTransfer:focused {
-fx-background-color: #DB5252;
}
#holder > #changeDir {
#holder>#changeDir {
-fx-background-color: transparent;
-fx-text-fill: #909090;
-fx-background-radius: 0;
}
#holder > #changeDir:focused,
#holder > #changeDir:pressed {
#holder>#changeDir:focused,
#holder>#changeDir:pressed {
-fx-font-weight: bold;
}
#holder > #apply,#applyTransfer{
#holder>#apply,
#applyTransfer {
-fx-background-color: #5fd97a;
-fx-background-radius: 0;
-fx-text-fill: white;
@ -75,8 +88,13 @@ #holder > #apply,#applyTransfer{
-fx-pref-width: 150px;
-fx-pref-height: 25px;
}
#holder > #apply:hover,#applyTransfer:hover,
#holder > #apply:focused,#applyTransfer:focused{
#holder>#apply:hover,
#applyTransfer:hover,
#holder>#apply:focused,
#applyTransfer:focused {
-fx-background-color: #75e18c;
}
/*-- DrLeonardo Design --*/

View file

@ -1,10 +1,11 @@
<?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.Slider?>
<?import java.net.URL?>
<?import javafx.scene.control.Hyperlink?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Slider?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.shape.Line?>
<?import javafx.scene.text.Font?>
@ -13,16 +14,22 @@
<!-- DrLeonardo Design -->
<Pane fx:id="overlay" prefHeight="450.0" prefWidth="693.0" xmlns="http://javafx.com/javafx/8.0.201" xmlns:fx="http://javafx.com/fxml/1">
<Pane fx:id="overlay" prefHeight="450.0" prefWidth="693.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Pane id="holder" prefHeight="450.0" prefWidth="694.0">
<children>
<CheckBox fx:id="autoEnter" layoutX="14.0" layoutY="137.0" text="Автовход на сервер" />
<Text fill="#8c8c8c" layoutX="40.0" layoutY="153.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Включение авто-входа означает что вы сразу после загрузки клиента попадете на сервер" wrappingWidth="636.9999872148037" y="15.0" />
<CheckBox fx:id="fullScreen" layoutX="13.0" layoutY="244.0" text="Клиент в полный экран" />
<Text fill="#8c8c8c" layoutX="40.0" layoutY="261.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Включение данной функции позволяет запустить игру сразу в полноэкранном режиме" wrappingWidth="636.9999872148037" y="15.0" />
<CheckBox id="debug" layoutX="13.0" layoutY="183.0" text="Режим Отладки" />
<Text fill="#8c8c8c" layoutX="40.0" layoutY="198.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Режим отладки позволяет просмотреть лог запуска и работы программы в реальном времени прямо из лаунчера, что упрощает поиск нужной информации" wrappingWidth="637.0000016447157" y="15.0" />
<CheckBox fx:id="autoEnter" layoutX="28.0" layoutY="169.0" text="Автовход на сервер">
<font>
<Font size="13.0" />
</font></CheckBox>
<CheckBox fx:id="fullScreen" layoutX="28.0" layoutY="229.0" text="Клиент в полный экран">
<font>
<Font size="13.0" />
</font></CheckBox>
<CheckBox id="debug" layoutX="28.0" layoutY="199.0" text="Режим Отладки">
<font>
<Font size="13.0" />
</font></CheckBox>
<TextFlow layoutX="126.0" layoutY="15.0" prefHeight="16.0" prefWidth="112.0">
<Text fx:id="ramLabel" />
</TextFlow>
@ -44,8 +51,20 @@
</children>
</Pane>
<Line endX="594.0" layoutX="100.0" layoutY="420.0" startX="-100.0" stroke="#5b3636" styleClass="lineHead" />
<CheckBox fx:id="featureStore" layoutX="13.0" layoutY="292.0" text="Поиск файлов в других клиентах" />
<Text fill="#8c8c8c" layoutX="40.0" layoutY="309.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Используется для экономии вашего трафика, аналогичные файлы будут скопированы с других игровых клиентов" wrappingWidth="636.9999872148037" y="15.0" />
<CheckBox fx:id="featureStore" layoutX="28.0" layoutY="259.0" text="Поиск файлов в других клиентах">
<font>
<Font size="13.0" />
</font></CheckBox>
<Text fx:id="description" layoutX="317.0" layoutY="208.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Режим отладки позволяет просмотреть лог запуска и работы программы в реальном времени прямо из лаунчера, что упрощает поиск нужной информации" wrappingWidth="260.888671875">
<font>
<Font size="13.0" />
</font>
</Text>
<Label fx:id="descLabel" layoutX="317.0" layoutY="169.0" text="Режим отладки">
<font>
<Font name="System Bold" size="14.0" />
</font>
</Label>
</children>
</Pane>
</children>

View file

@ -1,7 +1,13 @@
var settingsOverlay = {
/* ===================== OVERLAY ===================== */
overlay: null, ramLabel: null, dirLabel: null, transferDialog: null,
deleteDirPressedAgain: false, count: 0,
/* ===================== OVERLAY ===================== */
overlay: null,
ramLabel: null,
dirLabel: null,
transferDialog: null,
deleteDirPressedAgain: false,
count: 0,
descLabel: null,
description: null,
initOverlay: function() {
settingsOverlay.overlay = loadFXML("dialog/overlay/settings/settings.fxml");
@ -12,10 +18,12 @@ var settingsOverlay = {
autoEnterBox.setSelected(settings.autoEnter);
autoEnterBox.selectedProperty()["addListener(javafx.beans.value.ChangeListener)"](
function(o, ov, nv) settings.autoEnter = nv);
autoEnterBox.setOnMouseEntered(function() {
settingsOverlay.updateDesc(autoEnterBox.getText(), "Включение авто-входа означает что вы сразу после загрузки клиента попадете на сервер");
});
settingsOverlay.dirLabel = holder.lookup("#dirLabel");
settingsOverlay.dirLabel.setOnAction(function(event)
app.getHostServices().showDocument(settings.updatesDir.toUri()));
settingsOverlay.dirLabel.setOnAction(function(event) app.getHostServices().showDocument(settings.updatesDir.toUri()));
settingsOverlay.updateDirLabel();
settingsOverlay.transferDialog = holder.lookup("#transferDialog");
@ -33,15 +41,24 @@ var settingsOverlay = {
}
});
this.descLabel = holder.lookup("#descLabel");
this.description = holder.lookup("#description");
var featureStore = holder.lookup("#featureStore");
featureStore.setSelected(settings.featureStore);
featureStore.selectedProperty()["addListener(javafx.beans.value.ChangeListener)"](
function(o, ov, nv) settings.featureStore = nv);
featureStore.setOnMouseEntered(function() {
settingsOverlay.updateDesc(featureStore.getText(), "Используется для экономии вашего трафика, аналогичные файлы будут скопированы с других игровых клиентов");
});
var fullScreenBox = holder.lookup("#fullScreen");
fullScreenBox.setSelected(settings.fullScreen);
fullScreenBox.selectedProperty()["addListener(javafx.beans.value.ChangeListener)"](
function(o, ov, nv) settings.fullScreen = nv);
fullScreenBox.setOnMouseEntered(function() {
settingsOverlay.updateDesc(fullScreenBox.getText(), "Включение данной функции позволяет запустить игру сразу в полноэкранном режиме");
});
settingsOverlay.ramLabel = holder.lookup("#ramLabel");
settingsOverlay.updateRAMLabel();
@ -70,31 +87,42 @@ var settingsOverlay = {
settingsOverlay.deleteUpdatesDir();
settingsOverlay.deleteDirPressedAgain = false;
settingsOverlay.count = settingsOverlay.count+1;
if(settingsOverlay.count>9){
javafx.application.Platform.exit();
}
settingsOverlay.count = settingsOverlay.count + 1;
if (settingsOverlay.count > 9) {
javafx.application.Platform.exit();
}
deleteDirButton.setText(
settingsOverlay.count>8?"Прощай :(":
(settingsOverlay.count>7?"Я умираю!":
(settingsOverlay.count>5?"DeathCry, спаси!":
(settingsOverlay.count>4?"Умоляю, перестань!":
(settingsOverlay.count>3?"Да хорош уже!":"Ещё раз")
))));
settingsOverlay.count > 8 ? "Прощай :(" :
(settingsOverlay.count > 7 ? "Я умираю!" :
(settingsOverlay.count > 5 ? "DeathCry, спаси!" :
(settingsOverlay.count > 4 ? "Умоляю, перестань!" :
(settingsOverlay.count > 3 ? "Да хорош уже!" : "Ещё раз")
))));
});
var debugBox = settingsOverlay.overlay.lookup("#debug");
debugBox.setSelected(settings.debug);
debugBox.selectedProperty()["addListener(javafx.beans.value.ChangeListener)"](
function(o, ov, nv) settings.debug = nv);
debugBox.setOnMouseEntered(function() {
settingsOverlay.updateDesc(debugBox.getText(), "Режим отладки позволяет просмотреть лог запуска и работы программы в реальном времени прямо из лаунчера, что упрощает поиск нужной информации");
});
holder.lookup("#apply").setOnAction(function(event) overlay.hide(0, null));
},
updateDesc: function(label, desc) {
//На случай если человек решил избавится от этой фишки
if (this.descLabel == null) return;
if (this.description == null) return;
this.descLabel.setText(label);
this.description.setText(desc);
},
transferCatalogDialog: function(newDir) {
settingsOverlay.transferDialog.setVisible(true);
settingsOverlay.transferDialog.lookup("#cancelTransfer").setOnAction(function(event)
{
settingsOverlay.transferDialog.lookup("#cancelTransfer").setOnAction(function(event) {
settings.updatesDir = newDir;
DirBridge.dirUpdates = settings.updatesDir;
settingsOverlay.updateDirLabel();
@ -133,11 +161,11 @@ var settingsOverlay = {
setRAM: function(ram) {
if (ram>762&&ram<1024){
settings.ram = java.lang.Math["min(int,int)"](ram, FunctionalBridge.getJVMTotalMemory());
}else{
settings.ram = java.lang.Math["min(int,int)"](((ram / 256) | 0) * 256, FunctionalBridge.getJVMTotalMemory());
}
if (ram > 762 && ram < 1024) {
settings.ram = java.lang.Math["min(int,int)"](ram, FunctionalBridge.getJVMTotalMemory());
} else {
settings.ram = java.lang.Math["min(int,int)"](((ram / 256) | 0) * 256, FunctionalBridge.getJVMTotalMemory());
}
},
updateDirLabel: function() {
@ -148,9 +176,16 @@ LogHelper.debug("Dir: %s", DirBridge.dir);
/* ====================== CLI PARAMS ===================== */
var cliParams = {
login: null, password: null, profile: -1, autoLogin: false,
updatesDir: null, autoEnter: null, fullScreen: null, ram: -1,
offline: false, featureStore: null,
login: null,
password: null,
profile: -1,
autoLogin: false,
updatesDir: null,
autoEnter: null,
fullScreen: null,
ram: -1,
offline: false,
featureStore: null,
init: function(params) {
var named = params.getNamed();
@ -200,8 +235,7 @@ var cliParams = {
if (cliParams.profile >= 0) {
settings.profile = cliParams.profile;
}
if (cliParams.updatesDir !== null) {
}
if (cliParams.updatesDir !== null) {}
if (cliParams.autoEnter !== null) {
settings.autoLogin = cliParams.autoEnter;
}

View file

@ -6,16 +6,16 @@ #overlay {
-fx-background-image: url('../../images/downloader/blured.jpg');
}
#overlay > #utitle {
#overlay>#utitle {
-fx-alignment: top-left;
}
#overlay > #description {
#overlay>#description {
-fx-alignment: top-left;
-fx-wrap-text: true;
}
#overlay > #description.error {
#overlay>#description.error {
-fx-text-fill: #CE5757;
}
@ -29,15 +29,15 @@ .progress-bar {
-fx-background-color: transparent;
}
.progress-indicator{
-fx-background-color: transparent ;
.progress-indicator {
-fx-background-color: transparent;
}
.progress-indicator .indicator {
-fx-background-color: transparent ;
-fx-background-color: transparent;
}
.progress-bar > .bar {
.progress-bar>.bar {
-fx-background-image: url("../../images/downloader/line.png");
-fx-background-color: transparent;
-fx-background-insets: 0;
@ -45,9 +45,10 @@ .progress-bar > .bar {
-fx-padding: 0;
}
.progress-bar > .track {
.progress-bar>.track {
-fx-background-color: transparent;
-fx-background-insets: 0;
-fx-background-radius: 3px;
}
/*-- DrLeonardo Design --*/

View file

@ -1,5 +1,8 @@
var update = {
overlay: null, title: null, description: null, progress: null,
overlay: null,
title: null,
description: null,
progress: null,
initOverlay: function() {
update.overlay = loadFXML("dialog/overlay/update/update.fxml");
@ -41,7 +44,7 @@ var update = {
"Примерно осталось: %d:%02d:%02d%n",
state.filePath,
state.getTotalDownloadedMiB() + 0.0, state.getTotalSizeMiB() + 0.0,
state.getTotalDownloadedMiB() + 0.0, state.getTotalSizeMiB() + 0.0,
bps <= 0.0 ? 0.0 : bps / 1024.0,
estimatedHH, estimatedMM, estimatedSS
));
@ -83,10 +86,10 @@ function offlineUpdateRequest(dirName, dir, matcher, digest) {
/* Export functions */
function makeUpdateRequest(dirName, dir, matcher, digest, callback) {
var request = settings.offline ? { setStateCallback: function(stateCallback) { } } :
new UpdateRequest(dirName, dir, matcher, digest);
var task = settings.offline ? newTask(offlineUpdateRequest(dirName, dir, matcher, digest)) :
newRequestTask(request);
var request = settings.offline ? { setStateCallback: function(stateCallback) {} } :
new UpdateRequest(dirName, dir, matcher, digest);
var task = settings.offline ? newTask(offlineUpdateRequest(dirName, dir, matcher, digest)) :
newRequestTask(request);
update.setTaskProperties(task, request, callback);
task.updateMessage("Состояние: Хеширование");

View file

@ -1,54 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.net.URL?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.control.TextField?>
<?import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView?>
<?import java.net.URL?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.shape.Line?>
<!-- DrLeonardo Design -->
<Pane fx:id="background" prefWidth="738.0" xmlns="http://javafx.com/javafx/8.0.201" xmlns:fx="http://javafx.com/fxml/1">
<Pane fx:id="background" prefWidth="738.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Pane fx:id="bar" layoutX="692.0" prefHeight="425.0" prefWidth="43.0" styleClass="bar">
<children>
<Button id="hide" alignment="CENTER" contentDisplay="CENTER" layoutY="45.0"
text="" textAlignment="CENTER">
<graphic>
<MaterialDesignIconView fill="WHITE" glyphName="MINUS" size="30" textAlignment="CENTER"/>
</graphic>
</Button>
<Button id="close" alignment="CENTER" contentDisplay="CENTER" text=""
textAlignment="CENTER">
<graphic>
<MaterialDesignIconView fill="WHITE" glyphName="CLOSE" size="30" textAlignment="CENTER"/>
</graphic>
</Button>
<Button id="hide" alignment="CENTER" contentDisplay="CENTER" layoutY="45.0" minHeight="-Infinity" minWidth="-Infinity" text="" textAlignment="CENTER">
<graphic>
<ImageView>
<image>
<Image url="@../../images/icons/hide.png" />
</image>
</ImageView>
</graphic></Button>
<Button id="close" alignment="CENTER" contentDisplay="CENTER" minHeight="-Infinity" minWidth="-Infinity" text="" textAlignment="CENTER">
<graphic>
<ImageView>
<image>
<Image url="@../../images/icons/close.png" />
</image>
</ImageView>
</graphic></Button>
</children>
</Pane>
<TextArea fx:id="output" prefHeight="419.0" prefWidth="692.0">
<padding>
<Insets left="10.0" top="10.0"/>
<Insets left="10.0" top="10.0" />
</padding>
</TextArea>
<TextField fx:id="textField" layoutY="420.0" prefHeight="30.0" prefWidth="543.0"
promptText="Введите команду...">
<TextField fx:id="textField" layoutY="420.0" prefHeight="30.0" prefWidth="543.0" promptText="Введите команду...">
<opaqueInsets>
<Insets/>
<Insets />
</opaqueInsets>
<padding>
<Insets left="10.0"/>
<Insets left="10.0" />
</padding>
</TextField>
<Button fx:id="send" defaultButton="true" layoutX="542.0" layoutY="420.0" prefHeight="30.0" prefWidth="147.0"
text="Выполнить"/>
<Line endX="594.0" layoutX="98.0" layoutY="420.0" startX="-100.0" stroke="#5b3636" styleClass="lineHead"/>
<Button fx:id="send" defaultButton="true" layoutX="542.0" layoutY="420.0" prefHeight="30.0" prefWidth="147.0" text="Выполнить" />
<Line endX="594.0" layoutX="98.0" layoutY="420.0" startX="-100.0" stroke="#5b3636" styleClass="lineHead" />
</children>
<stylesheets>
<URL value="@../../styles.css"/>
<URL value="@../../overlay/debug/debug.css"/>
<URL value="@../../styles.css" />
<URL value="@../../overlay/debug/debug.css" />
</stylesheets>
</Pane>

View file

@ -1,19 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.String?>
<?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 de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView?>
<?import java.lang.String?>
<?import java.net.URL?>
<?import javafx.scene.control.Hyperlink?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.Pane?>
<!-- DrLeonardo Design -->
<Pane fx:id="loginPane" prefWidth="740.0" xmlns="http://javafx.com/javafx/8.0.201" xmlns:fx="http://javafx.com/fxml/1">
<Pane fx:id="loginPane" prefWidth="740.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Pane fx:id="layout" prefWidth="740.0">
<children>
@ -40,21 +41,30 @@
<Pane id="mask" opacity="0.0" prefHeight="450.0" prefWidth="694.0" visible="false" />
<Pane fx:id="bar" layoutX="694.0" prefHeight="425.0" prefWidth="43.0" styleClass="bar">
<children>
<Button id="hide" alignment="CENTER" contentDisplay="CENTER" layoutY="45.0" text="" textAlignment="CENTER">
<graphic>
<MaterialDesignIconView fill="WHITE" glyphName="MINUS" size="30" textAlignment="CENTER" />
</graphic>
</Button>
<Button id="close" alignment="CENTER" contentDisplay="CENTER" text="" textAlignment="CENTER">
<graphic>
<MaterialDesignIconView fill="WHITE" glyphName="CLOSE" size="30" textAlignment="CENTER" />
</graphic>
</Button>
<Button id="discord" alignment="CENTER" contentDisplay="CENTER" layoutY="370.0" text="" textAlignment="CENTER">
<graphic>
<MaterialDesignIconView fill="#5fd97a" glyphName="MESSAGE_TEXT" size="20" textAlignment="CENTER" />
</graphic>
</Button>
<Button id="hide" alignment="CENTER" contentDisplay="CENTER" layoutY="45.0" minHeight="-Infinity" minWidth="-Infinity" text="" textAlignment="CENTER">
<graphic>
<ImageView>
<image>
<Image url="@../../images/icons/hide.png" />
</image>
</ImageView>
</graphic></Button>
<Button id="close" alignment="CENTER" contentDisplay="CENTER" minHeight="-Infinity" minWidth="-Infinity" text="" textAlignment="CENTER">
<graphic>
<ImageView>
<image>
<Image url="@../../images/icons/close.png" />
</image>
</ImageView>
</graphic></Button>
<Button id="discord" alignment="CENTER" contentDisplay="CENTER" layoutY="370.0" minHeight="-Infinity" minWidth="-Infinity" text="" textAlignment="CENTER">
<graphic>
<ImageView>
<image>
<Image url="@../../images/icons/discord.png" />
</image>
</ImageView>
</graphic></Button>
</children>
</Pane>
</children>

View file

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView?>
<?import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView?>
<?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="serverPaneLayout" maxHeight="-1.0" maxWidth="-1.0" prefWidth="740.0" visible="true" xmlns="http://javafx.com/javafx/8.0.201" xmlns:fx="http://javafx.com/fxml/1">
<Pane fx:id="serverPaneLayout" maxHeight="-1.0" maxWidth="-1.0" prefWidth="740.0" visible="true" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Pane fx:id="layout" maxHeight="-1.0" maxWidth="-1.0" prefWidth="740.0" visible="true" xmlns="http://javafx.com/javafx/8.0.201" xmlns:fx="http://javafx.com/fxml/1">
<children>
@ -22,7 +22,7 @@
<ScrollPane id="serverlist" hbarPolicy="NEVER" layoutX="1.0" prefHeight="450.0" prefWidth="307.0" visible="true">
<content>
<FlowPane focusTraversable="false" prefHeight="446.0" prefWidth="306.0" prefWrapLength="0.0" rowValignment="TOP" vgap="10.0" visible="true">
<Button id="servercontainer" text="">
<Button id="servercontainer" text="">
<FlowPane.margin>
<Insets bottom="10.0" />
</FlowPane.margin></Button>
@ -51,10 +51,14 @@
<Font size="22.0" />
</font>
</Button>
<Button id="clientSettings" alignment="CENTER" centerShape="false" contentDisplay="CENTER" layoutX="305.0" layoutY="380.0" prefHeight="51.0" prefWidth="60.0" styleClass="clientSettings" text="" textAlignment="CENTER">
<graphic>
<FontAwesomeIconView fill="WHITE" glyphName="SLIDERS" size="30.0" />
</graphic></Button>
<Button id="clientSettings" alignment="CENTER" centerShape="false" contentDisplay="CENTER" layoutX="305.0" layoutY="380.0" minHeight="-Infinity" minWidth="-Infinity" prefHeight="51.0" prefWidth="60.0" styleClass="clientSettings" text="" textAlignment="CENTER">
<graphic>
<ImageView>
<image>
<Image url="@../../images/icons/list.png" />
</image>
</ImageView>
</graphic></Button>
<Label id="serverStatus" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="165.0" layoutY="12.0" prefHeight="25.0" prefWidth="97.0" text="12/100" textAlignment="RIGHT" textFill="WHITE">
<font>
<Font name="System Bold" size="16.0" />
@ -65,7 +69,7 @@
<Font name="System Bold" size="18.0" />
</font>
</Label>
<Button id="logout" alignment="CENTER" contentDisplay="CENTER" layoutX="295.0" layoutY="12.0" prefHeight="25.0" prefWidth="81.0" text="Выйти" textAlignment="CENTER" />
<Button id="logout" alignment="CENTER" contentDisplay="CENTER" layoutX="295.0" layoutY="12.0" prefHeight="25.0" prefWidth="81.0" text="Выйти" textAlignment="CENTER" />
</children>
</Pane>
</children>
@ -74,31 +78,46 @@
</Pane>
<Pane fx:id="bar" layoutX="694.0" prefHeight="425.0" prefWidth="43.0" styleClass="bar">
<children>
<Button id="hide" alignment="CENTER" contentDisplay="CENTER" layoutY="45.0" text="" textAlignment="CENTER">
<graphic>
<MaterialDesignIconView fill="WHITE" glyphName="MINUS" size="30" textAlignment="CENTER" />
</graphic>
</Button>
<Button id="close" alignment="CENTER" contentDisplay="CENTER" text="" textAlignment="CENTER">
<graphic>
<MaterialDesignIconView fill="WHITE" glyphName="CLOSE" size="30" textAlignment="CENTER" />
</graphic>
</Button>
<Button id="discord" alignment="CENTER" contentDisplay="CENTER" layoutY="380.0" text="" textAlignment="CENTER">
<graphic>
<MaterialDesignIconView fill="#5fd97a" glyphName="MESSAGE_TEXT" size="20" smooth="false" textAlignment="CENTER" />
</graphic>
</Button>
<Button id="settings" alignment="CENTER" contentDisplay="CENTER" layoutY="90.0" text="" textAlignment="CENTER">
<graphic>
<MaterialDesignIconView fill="WHITE" glyphName="SETTINGS" size="20" textAlignment="CENTER" />
</graphic>
</Button>
<Button id="goConsole" alignment="CENTER" contentDisplay="CENTER" layoutY="138.0" text="" textAlignment="CENTER">
<graphic>
<MaterialDesignIconView fill="WHITE" glyphName="CONSOLE" size="20" textAlignment="CENTER" />
</graphic>
</Button>
<Button id="hide" alignment="CENTER" contentDisplay="CENTER" layoutY="45.0" minHeight="-Infinity" minWidth="-Infinity" text="" textAlignment="CENTER">
<graphic>
<ImageView>
<image>
<Image url="@../../images/icons/hide.png" />
</image>
</ImageView>
</graphic></Button>
<Button id="close" alignment="CENTER" contentDisplay="CENTER" minHeight="-Infinity" minWidth="-Infinity" text="" textAlignment="CENTER">
<graphic>
<ImageView>
<image>
<Image url="@../../images/icons/close.png" />
</image>
</ImageView>
</graphic></Button>
<Button id="discord" alignment="CENTER" contentDisplay="CENTER" layoutY="380.0" minHeight="-Infinity" minWidth="-Infinity" text="" textAlignment="CENTER">
<graphic>
<ImageView>
<image>
<Image url="@../../images/icons/discord.png" />
</image>
</ImageView>
</graphic></Button>
<Button id="settings" alignment="CENTER" contentDisplay="CENTER" layoutY="90.0" minHeight="-Infinity" minWidth="-Infinity" text="" textAlignment="CENTER">
<graphic>
<ImageView>
<image>
<Image url="@../../images/icons/settings.png" />
</image>
</ImageView>
</graphic></Button>
<Button id="goConsole" alignment="CENTER" contentDisplay="CENTER" layoutY="138.0" minHeight="-Infinity" minWidth="-Infinity" text="" textAlignment="CENTER">
<graphic>
<ImageView>
<image>
<Image url="@../../images/icons/console.png" />
</image>
</ImageView>
</graphic></Button>
</children>
</Pane>
<Pane id="mask" opacity="0.0" prefHeight="450.0" prefWidth="694.0" visible="false" />

View file

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView?>
<?import java.net.URL?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.Line?>
@ -13,7 +14,7 @@
<!-- DrLeonardo Design -->
<Pane fx:id="background" prefHeight="450.0" prefWidth="740.0" xmlns="http://javafx.com/javafx/8.0.201" xmlns:fx="http://javafx.com/fxml/1">
<Pane fx:id="background" prefHeight="450.0" prefWidth="740.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Pane id="optionsPane" prefHeight="450.0" prefWidth="692.0" styleClass="optionsPane">
<children>
@ -38,21 +39,30 @@
</Pane>
<Pane fx:id="bar" layoutX="694.0" prefHeight="425.0" prefWidth="43.0" styleClass="bar">
<children>
<Button id="hide" alignment="CENTER" contentDisplay="CENTER" layoutY="45.0" text="" textAlignment="CENTER">
<graphic>
<MaterialDesignIconView fill="WHITE" glyphName="MINUS" size="30" textAlignment="CENTER" />
</graphic>
</Button>
<Button id="close" alignment="CENTER" contentDisplay="CENTER" text="" textAlignment="CENTER">
<graphic>
<MaterialDesignIconView fill="WHITE" glyphName="CLOSE" size="30" textAlignment="CENTER" />
</graphic>
</Button>
<Button id="back" alignment="CENTER" contentDisplay="CENTER" layoutY="405.0" text="" textAlignment="CENTER">
<graphic>
<MaterialDesignIconView fill="WHITE" glyphName="CHEVRON_LEFT" size="30" textAlignment="CENTER" />
</graphic>
</Button>
<Button id="hide" alignment="CENTER" contentDisplay="CENTER" layoutY="45.0" minHeight="-Infinity" minWidth="-Infinity" text="" textAlignment="CENTER">
<graphic>
<ImageView>
<image>
<Image url="@../../images/icons/hide.png" />
</image>
</ImageView>
</graphic></Button>
<Button id="close" alignment="CENTER" contentDisplay="CENTER" minHeight="-Infinity" minWidth="-Infinity" text="" textAlignment="CENTER">
<graphic>
<ImageView>
<image>
<Image url="@../../images/icons/close.png" />
</image>
</ImageView>
</graphic></Button>
<Button id="back" alignment="CENTER" contentDisplay="CENTER" layoutY="405.0" minHeight="-Infinity" minWidth="-Infinity" text="" textAlignment="CENTER">
<graphic>
<ImageView>
<image>
<Image url="@../../images/icons/back.png" />
</image>
</ImageView>
</graphic></Button>
</children>
</Pane>
</children>

View file

@ -5,7 +5,7 @@ var options = {
LogHelper.debug("Loading options file");
try {
tryWithResources(new HInput(IOHelper.newInput(options.file)), options.read);
} catch(e) {
} catch (e) {
LogHelper.error(e);
}
},
@ -14,7 +14,7 @@ var options = {
LogHelper.debug("Saving options file");
try {
tryWithResources(new HOutput(IOHelper.newOutput(options.file)), options.write);
} catch(e) {
} catch (e) {
LogHelper.error(e);
}
},
@ -24,33 +24,27 @@ var options = {
if (magic != config.settingsMagic) {
throw new java.io.IOException("options magic mismatch: " + java.lang.Integer.toString(magic, 16));
}
var profilesCount = input.readInt();
LogHelper.debug("Load options. ProfilesCount %d",profilesCount);
for(var i = 0;i<profilesCount;i++)
{
var profilesCount = input.readInt();
LogHelper.debug("Load options. ProfilesCount %d", profilesCount);
for (var i = 0; i < profilesCount; i++) {
var listSize = input.readInt();
var sortIndex = input.readInt();
var profile = null;
settings.lastProfiles.forEach(function(hprofile,i,arr) {
if(hprofile.getSortIndex() == sortIndex)
{
settings.lastProfiles.forEach(function(hprofile, i, arr) {
if (hprofile.getSortIndex() == sortIndex) {
profile = hprofile;
}
});
for(var j = 0; j < listSize; j++)
{
for (var j = 0; j < listSize; j++) {
var mark = input.readBoolean();
var modType = OptionalFile.readType(input);
var modFile = input.readString(0);
if(mark)
{
profile.markOptional(modFile,modType);
LogHelper.debug("Load options %s marked",modFile);
}
else
{
profile.unmarkOptional(modFile,modType);
LogHelper.debug("Load options %s unmarked",modFile);
if (mark) {
profile.markOptional(modFile, modType);
LogHelper.debug("Load options %s marked", modFile);
} else {
profile.unmarkOptional(modFile, modType);
LogHelper.debug("Load options %s unmarked", modFile);
}
}
}
@ -59,13 +53,13 @@ var options = {
write: function(output) {
output.writeInt(config.settingsMagic);
output.writeInt(settings.lastProfiles.length);
settings.lastProfiles.forEach(function(hprofile,i,arr) {
settings.lastProfiles.forEach(function(hprofile, i, arr) {
var profile = hprofile;
LogHelper.debug("Save options %s",profile.getTitle());
LogHelper.debug("Save options %s", profile.getTitle());
var list = profile.getOptional();
output.writeInt(list.size());
output.writeInt(profile.getSortIndex());
list.forEach(function(modFile,j,arr2) {
list.forEach(function(modFile, j, arr2) {
output.writeBoolean(modFile.mark);
modFile.writeType(output);
output.writeString(modFile.name, 0);
@ -80,80 +74,77 @@ var options = {
optionsPane = pane;
var modlist = pane.lookup("#modlist").getContent();
var nodelist = new java.util.ArrayList;
var nodelist = new java.util.ArrayList;
modlist.getChildren().forEach(function(node,i,arr) {
if(node instanceof javafx.scene.control.CheckBox)
nodelist.add(node);
modlist.getChildren().forEach(function(node, i, arr) {
if (node instanceof javafx.scene.control.CheckBox)
nodelist.add(node);
});
nodelist.forEach(function(node, i, arr) {
modlist.getChildren().remove(node);
});
var profile = profilesList[serverHolder.old];
var list = profile.getOptional();
var checkBoxList = new java.util.ArrayList;
list.forEach(function(modFile) {
var modName = modFile.name,
modDescription = "",
subLevel = 1;
if (!modFile.visible) {
LogHelper.debug("optionalMod %s hidden", modFile.name);
return;
}
if (modFile.permissions != 0 && ((loginData.permissions.toLong() & modFile.permissions) == 0)) {
LogHelper.debug("optionalMod %s permissions deny", modFile.name);
return;
}
if (modFile.info != null)
modDescription = modFile.info;
if (modFile.subTreeLevel != null && modFile.subTreeLevel > 1)
subLevel = modFile.subTreeLevel;
var testMod = new javafx.scene.control.CheckBox(modName);
testMod.getStyleClass().add("checkboxOpt");
if (subLevel > 1)
for (var i = 1; i < subLevel; i++)
testMod.setTranslateX(25 * i);
testMod.setSelected(modFile.mark);
testMod.setOnAction(function(event) {
var isSelected = event.getSource().isSelected();
if (isSelected) {
profile.markOptional(modFile);
LogHelper.debug("Selected mod %s", modFile.name);
} else {
profile.unmarkOptional(modFile);
LogHelper.debug("Unselected mod %s", modFile.name);
}
options.update();
});
nodelist.forEach(function(node,i,arr) {
modlist.getChildren().remove(node);
});
var profile = profilesList[serverHolder.old];
var list = profile.getOptional();
var checkBoxList = new java.util.ArrayList;
list.forEach(function(modFile) {
var modName = modFile.name, modDescription = "", subLevel = 1;
if(!modFile.visible)
{
LogHelper.debug("optionalMod %s hidden",modFile.name);
return;
}
if(modFile.permissions != 0 && ((loginData.permissions.toLong() & modFile.permissions) == 0))
{
LogHelper.debug("optionalMod %s permissions deny",modFile.name);
return;
}
if(modFile.info != null)
modDescription = modFile.info;
if(modFile.subTreeLevel != null && modFile.subTreeLevel > 1)
subLevel = modFile.subTreeLevel;
var testMod = new javafx.scene.control.CheckBox(modName);
testMod.getStyleClass().add("checkboxOpt");
if(subLevel > 1)
for(var i = 1; i < subLevel; i++)
testMod.setTranslateX(25*i);
testMod.setSelected(modFile.mark);
testMod.setOnAction(function(event) {
var isSelected = event.getSource().isSelected();
if(isSelected)
{
profile.markOptional(modFile);
LogHelper.debug("Selected mod %s", modFile.name);
}
else
{
profile.unmarkOptional(modFile);
LogHelper.debug("Unselected mod %s", modFile.name);
}
options.update();
});
testMod.setFocusTraversable(false);
checkBoxList.add(testMod);
testMod.getStyleClass().add("modname");
if(modDescription != "") {
textDescr = new javafx.scene.text.Text(modDescription);
if(subLevel > 1) {
for(var i = 1; i < subLevel; i++){
textDescr.setWrappingWidth(620-(25*i));
textDescr.setTranslateX(25+(25*i));
}
} else {
textDescr.setWrappingWidth(620);
textDescr.setTranslateX(25);
}
textDescr.setTextAlignment(javafx.scene.text.TextAlignment.JUSTIFY);
textDescr.getStyleClass().add("description-text");
checkBoxList.add(textDescr);
}
sep = new javafx.scene.control.Separator();
sep.getStyleClass().add("separator");
checkBoxList.add(sep);
});
modlist.getChildren().clear();
modlist.getChildren().addAll(checkBoxList);
testMod.setFocusTraversable(false);
checkBoxList.add(testMod);
testMod.getStyleClass().add("modname");
if (modDescription != "") {
textDescr = new javafx.scene.text.Text(modDescription);
if (subLevel > 1) {
for (var i = 1; i < subLevel; i++) {
textDescr.setWrappingWidth(620 - (25 * i));
textDescr.setTranslateX(25 + (25 * i));
}
} else {
textDescr.setWrappingWidth(620);
textDescr.setTranslateX(25);
}
textDescr.setTextAlignment(javafx.scene.text.TextAlignment.JUSTIFY);
textDescr.getStyleClass().add("description-text");
checkBoxList.add(textDescr);
}
sep = new javafx.scene.control.Separator();
sep.getStyleClass().add("separator");
checkBoxList.add(sep);
});
modlist.getChildren().clear();
modlist.getChildren().addAll(checkBoxList);
}
};

View file

@ -1,6 +1,6 @@
/*-- DrLeonardo Design --*/
/* Server buttons */
.server-button {
-fx-font-weight: bold;
-fx-font-size: 16pt;
@ -16,14 +16,14 @@ .server-button {
}
.server-button:selected {
-fx-effect: dropshadow(gaussian, rgba(23, 25, 29, 0.3), 15,0,0,3);
-fx-effect: dropshadow(gaussian, rgba(23, 25, 29, 0.3), 15, 0, 0, 3);
}
/** server-button-<your profile name> **/
.server-button-Example {
-fx-background-image: url('images/servers/example.png');
}
/*-- DrLeonardo Design --*/

View file

@ -1,6 +1,6 @@
/*-- Without jfoenix --*/
Button {
-fx-background-color: TRANSPARENT, TRANSPARENT, TRANSPARENT, TRANSPARENT;
-fx-background-color: TRANSPARENT, TRANSPARENT, TRANSPARENT, TRANSPARENT;
-fx-background-radius: 3px;
-fx-background-insets: 0px;
}
@ -12,7 +12,7 @@ CheckBox .box-container {
CheckBox .box,
CheckBox:indeterminate .box,
CheckBox:indeterminate:selected .box{
CheckBox:indeterminate:selected .box {
-fx-pref-width: 18;
-fx-pref-height: 18;
@ -27,11 +27,11 @@ CheckBox:indeterminate:selected .box{
CheckBox:selected .box {
-fx-border-color: #5fd97a;
-fx-background-color: #5fd97a;
-fx-background-color: #5fd97a;
}
CheckBox .mark {
-fx-background-color: TRANSPARENT;
-fx-background-color: TRANSPARENT;
}
CheckBox:selected .mark {
@ -46,7 +46,7 @@ CheckBox:selected .mark {
-fx-border-radius: 2;
}
CheckBox .indeterminate-mark{
CheckBox .indeterminate-mark {
-fx-background-color: #5fd97a;
-fx-background-radius: 2;
-fx-border-width: 0;
@ -56,8 +56,11 @@ CheckBox .indeterminate-mark{
/*-- DrLeonardo Design --*/
Button, CheckBox, ComboBox, RadioButton {
-fx-cursor: hand;
Button,
CheckBox,
ComboBox,
RadioButton {
-fx-cursor: hand;
}
@ -69,20 +72,22 @@ #layout {
-fx-pref-height: 450px;
-fx-background-image: url('images/background.jpg');
}
#background {
-fx-background-color: #fff;
}
/** Labels **/
#background > #settingsTitle {
#background>#settingsTitle {
-fx-font-size: 14pt;
-fx-alignment: baseline-center;
}
#serverLabel{
#serverLabel {
-fx-text-fill: #323232;
}
#serverStatus{
#serverStatus {
-fx-text-fill: #323232;
-fx-pref-width: 120px;
-fx-pref-height: 25px;
@ -90,17 +95,17 @@ #serverStatus{
/* Mask */
#mask {
-fx-effect: DropShadow( gaussian , rgba(255,255,255,0.5) , 0,0,0,1 );
-fx-effect: DropShadow(gaussian, rgba(255, 255, 255, 0.5), 0, 0, 0, 1);
}
/** Errors **/
#errormessage{
#errormessage {
-fx-background-color: transparent;
-fx-text-alignment: center;
-fx-text-fill: #CE5757;
}
.error{
.error {
-fx-text-fill: #CE5757;
}
@ -110,6 +115,7 @@ #bar {
-fx-pref-width: 46px;
-fx-pref-height: 450px;
}
/** buttons in bar **/
#close {
-fx-background-position: center;
@ -118,28 +124,35 @@ #close {
-fx-pref-width: 46px;
-fx-pref-height: 45px;
}
#hide, #back, #goConsole, #settings, #discord {
#hide,
#back,
#goConsole,
#settings,
#discord {
-fx-background-position: center;
-fx-background-radius: 0;
-fx-pref-width: 46px;
-fx-pref-height: 45px;
}
#logout{
-fx-text-fill:#323232;
-fx-font-size:12;
-fx-font-weight:normal;
-fx-border-color:#CE5757;
-fx-border-width:1;
-fx-background-color:transparent;
-fx-padding:0;
#logout {
-fx-text-fill: #323232;
-fx-font-size: 12;
-fx-font-weight: normal;
-fx-border-color: #CE5757;
-fx-border-width: 1;
-fx-background-color: transparent;
-fx-padding: 0;
}
#logout:hover,
#logout:focus{
-fx-text-fill:#ff6a5e;
#logout:focus {
-fx-text-fill: #ff6a5e;
}
#logout:pressed{
-fx-border-color:#cb4d43;
#logout:pressed {
-fx-border-color: #cb4d43;
}
#send {
@ -151,7 +164,9 @@ #send {
-fx-pref-height: 30px;
}
#send:pressed { -fx-background-color: #d8d8d8; }
#send:pressed {
-fx-background-color: #d8d8d8;
}
/* LoginMenu */
#authPane {
@ -176,18 +191,22 @@ .auth {
-fx-text-fill: #ffffff;
-fx-pref-width: 200px;
-fx-pref-height: 45px;
-fx-effect: dropshadow(gaussian, rgba(23, 25, 29, 0.3), 15,0,0,3);
-fx-effect: dropshadow(gaussian, rgba(23, 25, 29, 0.3), 15, 0, 0, 3);
}
.auth:hover, .auth:pressed { -fx-background-color: #75e18c; }
.auth:hover,
.auth:pressed {
-fx-background-color: #75e18c;
}
#password, #login {
#password,
#login {
-fx-background-radius: 0;
-fx-pref-width: 200px;
-fx-pref-height: 30px;
}
.text-input{
.text-input {
-fx-focus-color: transparent;
-fx-background-repeat: no-repeat;
-fx-text-fill: #909090;
@ -208,21 +227,26 @@ #link {
-fx-pref-height: 17px;
}
#link:hover, #link:pressed { -fx-opacity: 0.8; }
#link:hover,
#link:pressed {
-fx-opacity: 0.8;
}
/** CheckBox & ComboBox**/
#rememberchb{
#rememberchb {
-fx-font-size: 13;
-fx-text-fill: #909090;
-fx-pref-width: 145px;
-fx-pref-height: 30px;
}
#combologin {
-fx-text-fill: #909090;
-fx-prompt-text-fill: #909090;
-fx-pref-width: 200px;
-fx-pref-height: 30px;
}
.combologin,
.combologin {
-fx-font-size: 13px;
@ -240,7 +264,7 @@ .combologin .list-cell {
.combologin-popup .list-view {
-fx-background-color: white, white;
-fx-background-insets: 0, 1;
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 8, 0.0 , 0 , 0 );
-fx-effect: dropshadow(three-pass-box, rgba(0, 0, 0, 0.6), 8, 0.0, 0, 0);
}
.combologin .list-cell:filled:selected .text,
@ -253,20 +277,18 @@ .combologin .arrow {
-fx-background-color: #5fd97a;
}
.combologin-popup .list-view .list-cell
{
.combologin-popup .list-view .list-cell {
-fx-background-color: white;
}
.combologin-popup .list-view .list-cell:filled:selected, .combologin-popup .list-view .list-cell:filled:selected:hover
{
.combologin-popup .list-view .list-cell:filled:selected,
.combologin-popup .list-view .list-cell:filled:selected:hover {
-fx-background: -fx-accent;
-fx-background-color: -fx-selection-bar;
-fx-text-fill: #909090;
}
.combologin-popup .list-view .list-cell:filled:hover
{
.combologin-popup .list-view .list-cell:filled:hover {
-fx-background-color: white;
-fx-text-fill: #909090;
}
@ -286,20 +308,24 @@ .serverentrance {
}
/** buttons **/
.clientLaunch{
.clientLaunch {
-fx-font-weight: bold;
-fx-font-size: 16pt;
-fx-background-radius: 0;
-fx-background-color: #5fd97a;
-fx-text-fill: #ffffff;
}
.clientSettings{
.clientSettings {
-fx-background-position: center;
-fx-background-color: #5fd97a;
-fx-background-radius: 0;
}
.clientLaunch:hover, .clientLaunch:pressed { -fx-background-color: #75e18c; }
.clientLaunch:hover,
.clientLaunch:pressed {
-fx-background-color: #75e18c;
}
/* Scrolls */
.scroll-pane {
@ -340,11 +366,11 @@ .scroll-pane>.corner {
}
/* OptionsPane */
#optionsPane > #modlist {
#optionsPane>#modlist {
-fx-background-color: transparent;
}
#optionsPane > #modlist > .viewport {
#optionsPane>#modlist>.viewport {
-fx-background-color: transparent;
}
@ -368,38 +394,42 @@ .separator *.line {
-fx-border-width: 0 0 10 0;
}
#serverlist{
-fx-background-color: transparent;
}
#serverlist > .viewport {
#serverlist {
-fx-background-color: transparent;
}
#serverdesc{
-fx-background-color: transparent;
}
#serverdesc > .viewport {
#serverlist>.viewport {
-fx-background-color: transparent;
}
#serverinfo{
-fx-background-color: transparent;
}
#serverinfo > .viewport {
#serverdesc {
-fx-background-color: transparent;
}
#servercontainer{
#serverdesc>.viewport {
-fx-background-color: transparent;
}
#serverinfo {
-fx-background-color: transparent;
}
#serverinfo>.viewport {
-fx-background-color: transparent;
}
#servercontainer {
-fx-background-color: transparent;
-fx-pref-width: 282px;
-fx-pref-height: 75px;
}
.toggle-button:disabled{
.toggle-button:disabled {
-fx-opacity: 1.0;
}
.heading{
.heading {
-fx-text-fill: #555555;
}
/*-- DrLeonardo Design --*/

View file

@ -9,7 +9,8 @@ var LauncherApp = Java.extend(JSApplication, {
settings = SettingsManager.settings;
settingsManager.loadHDirStore();
cliParams.applySettings();
}, start: function(primaryStage) {
},
start: function(primaryStage) {
stage = primaryStage;
stage.initStyle(javafx.stage.StageStyle.TRANSPARENT);
stage.setResizable(false);
@ -45,7 +46,8 @@ var LauncherApp = Java.extend(JSApplication, {
setCurrentScene(loginScene);
initLauncher();
}, stop: function() {
},
stop: function() {
settingsManager.saveConfig();
settingsManager.saveHDirStore();
options.save();