mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
Сохранение текущего выбранного профиля
This commit is contained in:
parent
7c58959e24
commit
3b29043dca
1 changed files with 6 additions and 1 deletions
|
@ -276,19 +276,24 @@ function updateProfilesList(profiles) {
|
||||||
profilesList = [];
|
profilesList = [];
|
||||||
// Set profiles items
|
// Set profiles items
|
||||||
serverList.getChildren().clear();
|
serverList.getChildren().clear();
|
||||||
|
var index = 0;
|
||||||
profiles.forEach(function (profile, i, arr) {
|
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);
|
var serverBtn = new javafx.scene.control.ToggleButton(profile);
|
||||||
(function () {
|
(function () {
|
||||||
profilesList[serverBtn] = profile;
|
profilesList[serverBtn] = profile;
|
||||||
var hold = serverBtn;
|
var hold = serverBtn;
|
||||||
|
var hIndex = index;
|
||||||
serverBtn.setOnAction(function (event) {
|
serverBtn.setOnAction(function (event) {
|
||||||
serverHolder.set(hold);
|
serverHolder.set(hold);
|
||||||
|
settings.profile = hIndex;
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
serverList.getChildren().add(serverBtn);
|
serverList.getChildren().add(serverBtn);
|
||||||
|
index++;
|
||||||
});
|
});
|
||||||
serverHolder.set(serverList.getChildren().get(0));
|
LogHelper.debug("Load selected %d profile",settings.profile);
|
||||||
|
serverHolder.set(serverList.getChildren().get(settings.profile));
|
||||||
}
|
}
|
||||||
|
|
||||||
function pingServer(btn) {
|
function pingServer(btn) {
|
||||||
|
|
Loading…
Reference in a new issue