[FIX] Фикс runtime для работы с новыми опциональными модами

This commit is contained in:
Gravit 2019-01-22 12:29:57 +07:00
parent 8e2e9d4aee
commit 97f9f034e7
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
3 changed files with 12 additions and 6 deletions

View file

@ -98,14 +98,19 @@ var options = {
var profile = profilesList[serverHolder.old]; var profile = profilesList[serverHolder.old];
var list = profile.getOptional(); var list = profile.getOptional();
var checkBoxList = new java.util.ArrayList; var checkBoxList = new java.util.ArrayList;
var dModsIds = [];
list.forEach(function(modFile) { list.forEach(function(modFile) {
dModsIds.push(modFile.string);
var modName = modFile.name, modDescription = "", subLevel = 1; 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; return;
}
if(modFile.permissions != 0 && ((loginData.permissions.toLong() & modFile.permissions) != 0))
{
LogHelper.debug("optionalMod %s permissions deny",modFile.name);
return;
}
if(modFile.info != null) //Есть ли описание? if(modFile.info != null) //Есть ли описание?
modDescription = modFile.info; modDescription = modFile.info;
if(modFile.subTreeLevel != null && modFile.subTreeLevel > 1)//Это суб-модификация? if(modFile.subTreeLevel != null && modFile.subTreeLevel > 1)//Это суб-модификация?

View file

@ -46,6 +46,7 @@ public ClientPermissions(long data) {
canUSR3 = (data & (1 << 4)) != 0; canUSR3 = (data & (1 << 4)) != 0;
canBot = (data & (1 << 5)) != 0; canBot = (data & (1 << 5)) != 0;
} }
@LauncherAPI
public long toLong() public long toLong()
{ {
long result = 0; long result = 0;

View file

@ -17,7 +17,7 @@ public class OptionalFile {
@LauncherAPI @LauncherAPI
public boolean mark; public boolean mark;
@LauncherAPI @LauncherAPI
public boolean visible; public boolean visible = true;
@LauncherAPI @LauncherAPI
public String name; public String name;
@LauncherAPI @LauncherAPI