mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-24 16:46:53 +00:00
fix
This commit is contained in:
1 parent
f11eb5ae46
commit
e78141bb78
3 files changed
+9
-37
No files matched your search
+7
-35
@@ -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<byte> 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")}</color>" : $"{time3}</color>s")}</color> ({GetVitalText(id, true)})";
|
||||
break;
|
||||
|
||||
+1
-1
@@ -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"));
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user