diff --git a/Modules/Utils.cs b/Modules/Utils.cs index 5c1c267c8..521f18a1e 100644 --- a/Modules/Utils.cs +++ b/Modules/Utils.cs @@ -1865,10 +1865,7 @@ public static class Utils title = title.Replace("color=", string.Empty); if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla) - { text = ReplaceHexColorsWithSafeColors(text); - text = ReplaceDigitsOutsideRichText(text); - } PlayerControl sender = !addToHistory || GameStates.CurrentServerType == GameStates.ServerType.Vanilla ? PlayerControl.LocalPlayer : Main.AllAlivePlayerControls.MinBy(x => x.PlayerId) ?? Main.AllPlayerControls.MinBy(x => x.PlayerId) ?? PlayerControl.LocalPlayer; @@ -2185,7 +2182,7 @@ public static class Utils foreach (char c in text) { - if (c is >= '0' and <= '9' && digitCount == 5) + if (char.IsDigit(c) && digitCount == 5) { int lastNewline = sb.ToString().LastIndexOf('\n'); @@ -2319,37 +2316,6 @@ public static class Utils return CachedLetterOnlyHexColors; } - - static string ReplaceDigitsOutsideRichText(string text) - { - if (string.IsNullOrWhiteSpace(text)) return text; - - StringBuilder sb = new(text.Length); - bool insideTag = false; - - foreach (char c in text) - { - switch (c) - { - case '<': - insideTag = true; - sb.Append(c); - continue; - case '>': - insideTag = false; - sb.Append(c); - continue; - case >= '0' and <= '9' when !insideTag: - sb.Append((char)('0' + (c - '0'))); - break; - default: - sb.Append(c); - break; - } - } - - return sb.ToString(); - } } public static HashSet DirtyName = []; @@ -4264,6 +4230,12 @@ public static class Utils summary = $"{ColorString(Main.PlayerColors[id], name)} - {Deathrace.GetStatistics(id)}"; break; case CustomGameMode.Mingle: + if (!AmongUsClient.Instance.AmHost) + { + summary = $"{ColorString(Main.PlayerColors[id], name)} - {GetVitalText(id, true)}"; + break; + } + int time3 = Mingle.GetSurvivalTime(id); summary = $"{ColorString(Main.PlayerColors[id], name)} - <#e8cd46>{GetString("SurvivedTimePrefix")}: <#ffffff>{(time3 == 0 ? $"{GetString("SurvivedUntilTheEnd")}" : $"{time3}s")} ({GetVitalText(id, true)})"; break; diff --git a/Patches/HudPatch.cs b/Patches/HudPatch.cs index 608b19a13..a6c56f4c5 100644 --- a/Patches/HudPatch.cs +++ b/Patches/HudPatch.cs @@ -205,7 +205,7 @@ internal static class HudManagerPatch ActionButton usedButton = __instance.KillButton; if (usesPetInsteadOfKill) usedButton = __instance.PetButton; - __instance.KillButton?.OverrideText(player.GetRoleTypes() == RoleTypes.Viper ? GetString("KillButtonText.Viper") : GetString("KillButtonText")); + __instance.KillButton?.OverrideText(player.GetRoleTypes() == RoleTypes.Viper ? GetString("AbilityButtonText.Viper") : GetString("KillButtonText")); __instance.ReportButton?.OverrideText(GetString("ReportButtonText")); __instance.PetButton?.OverrideText(GetString("PetButtonText")); __instance.ImpostorVentButton?.OverrideText(GetString("VentButtonText")); diff --git a/Resources/Lang/en_US.json b/Resources/Lang/en_US.json index c5634de61..dccc7a6e6 100644 --- a/Resources/Lang/en_US.json +++ b/Resources/Lang/en_US.json @@ -3224,7 +3224,7 @@ "AbilityButtonText.Impostor": "Haunt", "AbilityButtonText.Shapeshifter": "Shift", "AbilityButtonText.Phantom": "Vanish", - "KillButtonText.Viper": "Acid", + "AbilityButtonText.Viper": "Acid", "AbilityButtonText.Detective": "Notes", "SecondaryAbilityButtonText.Detective": "Interrogate", "GauloisKillButtonText": "Speed Up",