1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-09 23:00:57 -05:00

implement custom tag (descriptor) feature

allow override of level names through configuration
few small fixes/improvements
This commit is contained in:
RaidMax
2021-01-24 11:47:19 -06:00
parent ba62afbe99
commit 92e7a8bd2b
40 changed files with 5576 additions and 184 deletions

View File

@ -59,6 +59,7 @@ namespace SharedLibraryCore
/// fallback id for world events
/// </summary>
public const long WORLD_ID = -1;
public static Dictionary<Permission, string> PermissionLevelOverrides { get; } = new Dictionary<Permission, string>();
public static string HttpRequest(string location, string header, string headerValue)
{
@ -219,9 +220,12 @@ namespace SharedLibraryCore
return $"^{colorCode}{localizedLevel ?? level.ToString()}";
}
public static string ToLocalizedLevelName(this EFClient.Permission perm)
public static string ToLocalizedLevelName(this Permission permission)
{
return CurrentLocalization.LocalizationIndex[$"GLOBAL_PERMISSION_{perm.ToString().ToUpper()}"];
var localized = CurrentLocalization.LocalizationIndex[$"GLOBAL_PERMISSION_{permission.ToString().ToUpper()}"];
return PermissionLevelOverrides.ContainsKey(permission) && PermissionLevelOverrides[permission] != localized
? PermissionLevelOverrides[permission]
: localized;
}
public async static Task<string> ProcessMessageToken(this Server server, IList<Helpers.MessageToken> tokens, String str)