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:
@ -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)
|
||||
|
Reference in New Issue
Block a user