mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +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 = [];
|
||||
// Set profiles items
|
||||
serverList.getChildren().clear();
|
||||
var index = 0;
|
||||
profiles.forEach(function (profile, i, arr) {
|
||||
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;
|
||||
var hIndex = index;
|
||||
serverBtn.setOnAction(function (event) {
|
||||
serverHolder.set(hold);
|
||||
settings.profile = hIndex;
|
||||
});
|
||||
})();
|
||||
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) {
|
||||
|
|
Loading…
Reference in a new issue