From aa91d12d2799553ac1b34271bf2c95c625c2b695 Mon Sep 17 00:00:00 2001 From: Gravit Date: Mon, 12 Nov 2018 22:27:44 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BE=D0=BF=D1=86=D0=B8=D0=BE=D0=BD=D0=B0?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D1=8B=D1=85=20=D0=BC=D0=BE=D0=B4=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Launcher/runtime/dialog/dialog.js | 1 + .../runtime/dialog/overlay/options/options.js | 43 ++++++++++++++++++- Launcher/runtime/init.js | 1 - 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/Launcher/runtime/dialog/dialog.js b/Launcher/runtime/dialog/dialog.js index 2ca9cf9d..7cab597e 100644 --- a/Launcher/runtime/dialog/dialog.js +++ b/Launcher/runtime/dialog/dialog.js @@ -198,6 +198,7 @@ function verifyLauncher(e) { } overlay.swap(0, processing.overlay, function(event) makeProfilesRequest(function(result) { settings.lastProfiles = result.profiles; + options.load(); // Update profiles list and hide overlay updateProfilesList(result.profiles); overlay.hide(0, function() { diff --git a/Launcher/runtime/dialog/overlay/options/options.js b/Launcher/runtime/dialog/overlay/options/options.js index 5ad2fc0e..b6642aba 100644 --- a/Launcher/runtime/dialog/overlay/options/options.js +++ b/Launcher/runtime/dialog/overlay/options/options.js @@ -2,7 +2,7 @@ var options = { file: DirBridge.dir.resolve("options.bin"), // options file /* options and overlay functions */ - load: function() { + load: function(profiles) { LogHelper.debug("Loading options file"); try { tryWithResources(new HInput(IOHelper.newInput(options.file)), options.read); @@ -27,10 +27,51 @@ 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