From 97f9f034e750f74d00035d0e9b845d014069aa9c Mon Sep 17 00:00:00 2001 From: Gravit Date: Tue, 22 Jan 2019 12:29:57 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=A4=D0=B8=D0=BA=D1=81=20runtime=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20?= =?UTF-8?q?=D1=81=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=BC=D0=B8=20=D0=BE=D0=BF?= =?UTF-8?q?=D1=86=D0=B8=D0=BE=D0=BD=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B=D0=BC?= =?UTF-8?q?=D0=B8=20=D0=BC=D0=BE=D0=B4=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../runtime/dialog/overlay/options/options.js | 15 ++++++++++----- .../ru/gravit/launcher/ClientPermissions.java | 1 + .../launcher/profiles/optional/OptionalFile.java | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Launcher/runtime/dialog/overlay/options/options.js b/Launcher/runtime/dialog/overlay/options/options.js index 6c443423..336c99b8 100644 --- a/Launcher/runtime/dialog/overlay/options/options.js +++ b/Launcher/runtime/dialog/overlay/options/options.js @@ -98,14 +98,19 @@ var options = { var profile = profilesList[serverHolder.old]; var list = profile.getOptional(); var checkBoxList = new java.util.ArrayList; - var dModsIds = []; - list.forEach(function(modFile) { - dModsIds.push(modFile.string); - var modName = modFile.name, modDescription = "", subLevel = 1; - if(!modFile.isVisible || !((loginData.permissions & modFile.permissions) != 0)) + if(!modFile.isVisible) + { + 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)//Это суб-модификация? diff --git a/libLauncher/src/main/java/ru/gravit/launcher/ClientPermissions.java b/libLauncher/src/main/java/ru/gravit/launcher/ClientPermissions.java index 0c77e2bc..c13828a6 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/ClientPermissions.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/ClientPermissions.java @@ -46,6 +46,7 @@ public ClientPermissions(long data) { canUSR3 = (data & (1 << 4)) != 0; canBot = (data & (1 << 5)) != 0; } + @LauncherAPI public long toLong() { long result = 0; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/profiles/optional/OptionalFile.java b/libLauncher/src/main/java/ru/gravit/launcher/profiles/optional/OptionalFile.java index 35e8a9f7..878b6e3d 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/profiles/optional/OptionalFile.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/profiles/optional/OptionalFile.java @@ -17,7 +17,7 @@ public class OptionalFile { @LauncherAPI public boolean mark; @LauncherAPI - public boolean visible; + public boolean visible = true; @LauncherAPI public String name; @LauncherAPI