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