Возможность сделать опциональные моды только для админов

This commit is contained in:
Gravit 2019-01-04 23:01:45 +07:00
parent 02c82745d0
commit 104ece2be4
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
4 changed files with 6 additions and 4 deletions

View file

@ -214,7 +214,7 @@ function doAuth(login, rsaPassword) {
processing.resetOverlay(); processing.resetOverlay();
overlay.show(processing.overlay, function (event) { overlay.show(processing.overlay, function (event) {
makeAuthRequest(login, rsaPassword, function (result) { makeAuthRequest(login, rsaPassword, function (result) {
loginData = { pp: result.pp , accessToken: result.accessToken}; loginData = { pp: result.pp , accessToken: result.accessToken, permissions: result.permissions};
overlay.hide(0, function () { overlay.hide(0, function () {
setCurrentScene(menuScene); setCurrentScene(menuScene);

View file

@ -102,7 +102,8 @@ var options = {
dModsIds.push(modFile.string); dModsIds.push(modFile.string);
var modName = modFile.file, modDescription = "", subLevel = 1; var modName = modFile.file, modDescription = "", subLevel = 1;
if(modFile.isAdminOnly && !loginData.permissions.canAdmin)
return;
if(modFile.name != null)//Есть ли у модификации имя? if(modFile.name != null)//Есть ли у модификации имя?
modName = modFile.name; modName = modFile.name;
if(modFile.info != null) //Есть ли описание? if(modFile.info != null) //Есть ли описание?

View file

@ -114,6 +114,8 @@ public static class OptionalFile {
@LauncherAPI @LauncherAPI
public int subTreeLevel = 1; public int subTreeLevel = 1;
@LauncherAPI @LauncherAPI
public boolean isAdminOnly = false;
@LauncherAPI
public transient Set<OptionalFile> dependenciesCount; public transient Set<OptionalFile> dependenciesCount;
public OptionalFile(String file, boolean mark) { public OptionalFile(String file, boolean mark) {
@ -261,7 +263,6 @@ public void updateOptionalGraph()
file.conflict[i] = getOptionalFile(file.conflictFile[i]); file.conflict[i] = getOptionalFile(file.conflictFile[i]);
} }
} }
} }
} }

@ -1 +1 @@
Subproject commit ec1431605c4951ace5cbd2ab392b67cea25bddd5 Subproject commit 09a3e87500b775e48d374d30c40acef55c88774a