diff --git a/lang/en.json b/lang/en.json index 4511c15..632d174 100644 --- a/lang/en.json +++ b/lang/en.json @@ -53,6 +53,9 @@ "warden.give_freeday_cmd": "give_freeday", "warden.give_pardon_cmd": "give_pardon", "warden.colour_cmd": "colour", + "warden.warden_prefix": "{green}[Warden]: {white}", + "warden.door_prefix": "{green}[Door]: {white}", + "warden.team_prefix": "{green}[Team]: {white}", "warden.give_pardon": "{0} has been pardoned", "warden.give_freeday": "{0} has been given a freeday", @@ -78,11 +81,14 @@ "mute.thirty": "All t's are muted for the first 30 seconds", "mute.speak_quietly": "T's may now speak quietly", "mute.end_round": "You are muted until the end of the round", + "mute.mute_prefix": "{green}[Mute]: {white}", "warday.live": "Weapons live!", "warday.location": "warday at {0}", + "warday.warday_prefix": "{green}[Warday]: {white}", "rebel.kill": "{0} killed the rebel {1}", + "rebel.rebel_prefix": "{green}[Rebel]: {white}", "block.enable": "Block enabled", "block.disable": "Block disabled", @@ -118,6 +124,7 @@ "sd.start_cmd": "sd", "sd.start_ff_cmd": "sd_ff", "sd.cancel_cmd": "sd_cancel", + "sd.sd_prefix": "{green}[Special Day]: {white}", "lr.rebel_last": "You must be the last player alive to rebel", @@ -137,5 +144,6 @@ "lr.cancel_lr_cmd": "cancel_lr", "lr.start_lr_cmd": "lr", - "lr.stats_cmd": "lr_stats" + "lr.stats_cmd": "lr_stats", + "lr.lr_prefix": "{green}[LR]: {white}" } diff --git a/src/Jail.cs b/src/Jail.cs index 5c347ac..d670804 100644 --- a/src/Jail.cs +++ b/src/Jail.cs @@ -197,6 +197,8 @@ public override void Load(bool hotReload) RegisterListeners(); + LocalizePrefix(); + JailPlayer.SetupDB(); Console.WriteLine("Sucessfully started JB"); @@ -205,6 +207,21 @@ public override void Load(bool hotReload) } + void LocalizePrefix() + { + LastRequest.LR_PREFIX = Chat.Localize("lr.lr_prefix"); + Entity.DOOR_PREFIX = Chat.Localize("warden.door_prefix"); + + SpecialDay.SPECIALDAY_PREFIX = Chat.Localize("sd.sd_prefix"); + JailPlayer.REBEL_PREFIX = Chat.Localize("rebel.rebel_prefix"); + + Mute.MUTE_PREFIX = Chat.Localize("mute.mute_prefix"); + Warden.TEAM_PREFIX = Chat.Localize("warden.team_prefix"); + + Warday.WARDAY_PREFIX = Chat.Localize("warday.warday_prefix"); + Warden.WARDEN_PREFIX = Chat.Localize("warden.warden_prefix"); + } + void StatDBReload() { Task.Run(async () => diff --git a/src/LastRequest/LastRequest.cs b/src/LastRequest/LastRequest.cs index 0f1e46a..0482b86 100644 --- a/src/LastRequest/LastRequest.cs +++ b/src/LastRequest/LastRequest.cs @@ -525,5 +525,5 @@ internal class LRChoice long startTimestamp = 0; - public static readonly String LR_PREFIX = $" {ChatColors.Green}[LR]: {ChatColors.White}"; + public static String LR_PREFIX = $" {ChatColors.Green}[LR]: {ChatColors.White}"; } \ No newline at end of file diff --git a/src/Lib/Entity.cs b/src/Lib/Entity.cs index 134e7f6..ae0de3a 100644 --- a/src/Lib/Entity.cs +++ b/src/Lib/Entity.cs @@ -119,7 +119,7 @@ static public int DrawLaser(Vector start, Vector end, float width, Color colour) return (int)laser.Index; } - static String DOOR_PREFIX = $" {ChatColors.Green}[Door control]: {ChatColors.White}"; + public static String DOOR_PREFIX = $" {ChatColors.Green}[Door control]: {ChatColors.White}"; public static void ForceClose() { diff --git a/src/SpecialDay/SpecialDay.cs b/src/SpecialDay/SpecialDay.cs index c29d0fd..7e036ae 100644 --- a/src/SpecialDay/SpecialDay.cs +++ b/src/SpecialDay/SpecialDay.cs @@ -299,7 +299,7 @@ public enum SDType NONE }; - public static readonly String SPECIALDAY_PREFIX = $" {ChatColors.Green}[Special day]: {ChatColors.White}"; + public static String SPECIALDAY_PREFIX = $" {ChatColors.Green}[Special day]: {ChatColors.White}"; static String[] SD_NAME = { "Friendly fire", diff --git a/src/Warden/JailPlayer.cs b/src/Warden/JailPlayer.cs index 7485bce..1312be7 100644 --- a/src/Warden/JailPlayer.cs +++ b/src/Warden/JailPlayer.cs @@ -371,7 +371,7 @@ public void PlayerHurt(CCSPlayerController? player, CCSPlayerController? attacke } - public static readonly String REBEL_PREFIX = $" {ChatColors.Green}[REBEL]: {ChatColors.White}"; + public static String REBEL_PREFIX = $" {ChatColors.Green}[REBEL]: {ChatColors.White}"; public static JailConfig Config = new JailConfig(); diff --git a/src/Warden/Mute.cs b/src/Warden/Mute.cs index 9b405e0..78dbf73 100644 --- a/src/Warden/Mute.cs +++ b/src/Warden/Mute.cs @@ -170,7 +170,7 @@ public void SwitchTeam(CCSPlayerController? player,int new_team) CSTimer.Timer? muteTimer = null; - static readonly String MUTE_PREFIX = $" {ChatColors.Green}[MUTE]: {ChatColors.White}"; + public static String MUTE_PREFIX = $" {ChatColors.Green}[MUTE]: {ChatColors.White}"; // has the mute timer finished? bool muteActive = false; diff --git a/src/Warden/Team.cs b/src/Warden/Team.cs index 30b732c..f51273b 100644 --- a/src/Warden/Team.cs +++ b/src/Warden/Team.cs @@ -20,7 +20,7 @@ public partial class Warden { - static readonly String TEAM_PREFIX = $" {ChatColors.Green}[TEAM]: {ChatColors.White}"; + public static String TEAM_PREFIX = $" {ChatColors.Green}[TEAM]: {ChatColors.White}"; public bool JoinTeam(CCSPlayerController? invoke, CommandInfo command) { diff --git a/src/Warden/Warday.cs b/src/Warden/Warday.cs index 64ed9e6..eb01972 100644 --- a/src/Warden/Warday.cs +++ b/src/Warden/Warday.cs @@ -94,7 +94,7 @@ public void MapStart() public JailConfig Config = new JailConfig(); - String WARDAY_PREFIX = $" {ChatColors.Green} [Warday]: {ChatColors.White}"; + public static String WARDAY_PREFIX = $" {ChatColors.Green} [Warday]: {ChatColors.White}"; bool wardayActive = false; diff --git a/src/Warden/Warden.cs b/src/Warden/Warden.cs index 37358f0..f6ad19e 100644 --- a/src/Warden/Warden.cs +++ b/src/Warden/Warden.cs @@ -186,7 +186,7 @@ public void SetupPlayerGuns(CCSPlayerController? player) int wardenSlot = INAVLID_SLOT; - public static readonly String WARDEN_PREFIX = $" {ChatColors.Green}[WARDEN]: {ChatColors.White}"; + public static String WARDEN_PREFIX = $" {ChatColors.Green}[WARDEN]: {ChatColors.White}"; long wardenTimestamp = -1;