Skip to content

Commit

Permalink
Fix wrong strings after utf8 purge
Browse files Browse the repository at this point in the history
  • Loading branch information
NikoCat233 committed Jan 15, 2025
1 parent ea726df commit c2c4893
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Patches/IntroPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ private static System.Collections.IEnumerator CoLoggerGameInfo()
foreach (OptionItem o in OptionItem.AllOptions)
{
if (!o.IsHiddenOn(Options.CurrentGameMode) && (o.Parent?.GetBool() ?? !o.GetString().Equals("0%")))
sb.Append($"{(o.Parent == null ? o.GetName(true, true).RemoveHtmlTags().PadRightV2(40) : $"â”— {o.GetName(true, true).RemoveHtmlTags()}".PadRightV2(41))}:{o.GetString().RemoveHtmlTags()}\n");
sb.Append($"{(o.Parent == null ? o.GetName(true, true).RemoveHtmlTags().PadRightV2(40) : $" {o.GetName(true, true).RemoveHtmlTags()}".PadRightV2(41))}:{o.GetString().RemoveHtmlTags()}\n");
}

yield return null;
Expand Down
6 changes: 3 additions & 3 deletions Patches/OutroPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)] ref En
var targetId = kvp.Key;
sb.Append($"\n{date:T} {Main.AllPlayerNames[targetId]}({(Options.CurrentGameMode == CustomGameMode.FFA ? string.Empty : Utils.GetDisplayRoleAndSubName(targetId, targetId, true))}{(Options.CurrentGameMode == CustomGameMode.FFA ? string.Empty : Utils.GetSubRolesText(targetId, summary: true))}) [{Utils.GetVitalText(kvp.Key)}]");
if (killerId != byte.MaxValue && killerId != targetId)
sb.Append($"\n\t {Main.AllPlayerNames[killerId]}({(Options.CurrentGameMode == CustomGameMode.FFA ? string.Empty : Utils.GetDisplayRoleAndSubName(killerId, killerId, true))}{(Options.CurrentGameMode == CustomGameMode.FFA ? string.Empty : Utils.GetSubRolesText(killerId, summary: true))})");
sb.Append($"\n\t {Main.AllPlayerNames[killerId]}({(Options.CurrentGameMode == CustomGameMode.FFA ? string.Empty : Utils.GetDisplayRoleAndSubName(killerId, killerId, true))}{(Options.CurrentGameMode == CustomGameMode.FFA ? string.Empty : Utils.GetSubRolesText(killerId, summary: true))})");
}
else
{
Expand All @@ -104,9 +104,9 @@ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)] ref En
var killerId = kvp.Value.GetRealKiller();
var targetId = kvp.Key;

sb.Append($"\n<line-height=85%><size=85%><voffset=-1em><color=#9c9c9c>{date:T}</color> {Main.AllPlayerNames[targetId]}({(Options.CurrentGameMode == CustomGameMode.FFA ? string.Empty : Utils.GetDisplayRoleAndSubName(targetId, targetId, true))}{(Options.CurrentGameMode == CustomGameMode.FFA ? string.Empty : Utils.GetSubRolesText(targetId, summary: true))}) ÒÇÄ{Utils.GetVitalText(kvp.Key, true)}ÒÇÅ</voffset></size></line-height>");
sb.Append($"\n<line-height=85%><size=85%><voffset=-1em><color=#9c9c9c>{date:T}</color> {Main.AllPlayerNames[targetId]}({(Options.CurrentGameMode == CustomGameMode.FFA ? string.Empty : Utils.GetDisplayRoleAndSubName(targetId, targetId, true))}{(Options.CurrentGameMode == CustomGameMode.FFA ? string.Empty : Utils.GetSubRolesText(targetId, summary: true))}) {Utils.GetVitalText(kvp.Key, true)}</voffset></size></line-height>");
if (killerId != byte.MaxValue && killerId != targetId)
sb.Append($"<br>\t {Main.AllPlayerNames[killerId]}({(Options.CurrentGameMode == CustomGameMode.FFA ? string.Empty : Utils.GetDisplayRoleAndSubName(killerId, killerId, true))}{(Options.CurrentGameMode == CustomGameMode.FFA ? string.Empty : Utils.GetSubRolesText(killerId, summary: true))})");
sb.Append($"<br>\t {Main.AllPlayerNames[killerId]}({(Options.CurrentGameMode == CustomGameMode.FFA ? string.Empty : Utils.GetDisplayRoleAndSubName(killerId, killerId, true))}{(Options.CurrentGameMode == CustomGameMode.FFA ? string.Empty : Utils.GetSubRolesText(killerId, summary: true))})");
}

}
Expand Down
4 changes: 2 additions & 2 deletions Patches/PlayerJoinAndLeftPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public static void Postfix(/*AmongUsClient __instance,*/ [HarmonyArgument(0)] Cl
if (DestroyableSingleton<FriendsListManager>.Instance.IsPlayerBlockedUsername(client.FriendCode) && AmongUsClient.Instance.AmHost)
{
AmongUsClient.Instance.KickPlayer(client.Id, true);
Logger.Info($"Ban Player Òâ╝ {client?.PlayerName}({client.FriendCode}) has been banned.", "BAN");
Logger.Info($"Ban Player => {client?.PlayerName}({client.FriendCode}) has been banned.", "BAN");
}
BanManager.CheckBanPlayer(client);

Expand All @@ -293,7 +293,7 @@ public static void Postfix(/*AmongUsClient __instance,*/ [HarmonyArgument(0)] Cl
BanManager.TempBanWhiteList.Add(client.GetHashedPuid());
AmongUsClient.Instance.KickPlayer(client.Id, true);
Logger.SendInGame(string.Format(GetString("Message.TempBannedForSpamQuitting"), client.PlayerName));
Logger.Info($"Temp Ban Player Òâ╝ {client?.PlayerName}({client.FriendCode}) has been temp banned.", "BAN");
Logger.Info($"Temp Ban Player => {client?.PlayerName}({client.FriendCode}) has been temp banned.", "BAN");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Roles/Crewmate/Marshall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public override string GetMark(PlayerControl seer, PlayerControl target = null,
{
target ??= seer;

return IsMarshallTarget(seer) && GetExpose(target) ? Utils.ColorString(RoleColor, "★") : string.Empty;
return IsMarshallTarget(seer) && GetExpose(target) ? Utils.ColorString(RoleColor, "") : string.Empty;
}

private static bool VisibleToCrewmate(PlayerControl seer, PlayerControl target) => target.GetPlayerTaskState().IsTaskFinished && target.Is(CustomRoles.Marshall) && seer.Is(Custom_Team.Crewmate);
Expand Down
6 changes: 3 additions & 3 deletions Roles/Crewmate/Snitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public override string GetMark(PlayerControl seer, PlayerControl seen, bool isFo
{
if (seen == seer) return string.Empty;

return IsSnitchTarget(seen) && IsComplete[seer.PlayerId] ? Utils.ColorString(RoleColor, "ÔÜá") : string.Empty;
return IsSnitchTarget(seen) && IsComplete[seer.PlayerId] ? Utils.ColorString(RoleColor, "") : string.Empty;
}
public override string GetSuffix(PlayerControl seer, PlayerControl target = null, bool isForMeeting = false)
{
Expand All @@ -222,7 +222,7 @@ public override string GetMarkOthers(PlayerControl seer, PlayerControl target, b
{
if (target == null) return string.Empty;

return IsSnitchTarget(seer) && GetExpose(target) ? Utils.ColorString(RoleColor, "ÔÜá") : string.Empty;
return IsSnitchTarget(seer) && GetExpose(target) ? Utils.ColorString(RoleColor, "") : string.Empty;
}

public override string GetSuffixOthers(PlayerControl seer, PlayerControl target, bool isForMeeting = false)
Expand All @@ -233,7 +233,7 @@ public override string GetSuffixOthers(PlayerControl seer, PlayerControl target,
var exposedSnitch = playerIdList.Where(s => !Main.PlayerStates[s].IsDead && IsExposed[s]).ToArray();
if (exposedSnitch.Length <= 0) return string.Empty;

var warning = "ÔÜá";
var warning = "";
if (EnableTargetArrow)
warning += TargetArrow.GetArrows(seer, [.. exposedSnitch]);

Expand Down
8 changes: 4 additions & 4 deletions Roles/Crewmate/Telecommunication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ public override string GetSuffix(PlayerControl seer, PlayerControl seen = null,
if (seer.PlayerId != seen.PlayerId || isForMeeting) return string.Empty;

StringBuilder sb = new();
if (IsAdminWatch) sb.Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), "★")).Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), GetString("AdminWarning")));
if (IsVitalWatch) sb.Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), "★")).Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), GetString("VitalsWarning")));
if (IsDoorLogWatch) sb.Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), "★")).Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), GetString("DoorlogWarning")));
if (IsCameraWatch) sb.Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), "★")).Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), GetString("CameraWarning")));
if (IsAdminWatch) sb.Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), "")).Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), GetString("AdminWarning")));
if (IsVitalWatch) sb.Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), "")).Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), GetString("VitalsWarning")));
if (IsDoorLogWatch) sb.Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), "")).Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), GetString("DoorlogWarning")));
if (IsCameraWatch) sb.Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), "")).Append(ColorString(GetRoleColor(CustomRoles.Telecommunication), GetString("CameraWarning")));

return sb.ToString();
}
Expand Down
2 changes: 1 addition & 1 deletion Roles/Impostor/Consigliere.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private static void SetDivination(PlayerControl killer, PlayerControl target)
{
DivinationCount[killer.PlayerId]--;
DivinationTarget[killer.PlayerId].Add(target.PlayerId);
Logger.Info($"{killer.GetNameWithRole()}:Checked→{target.GetNameWithRole()} || Remaining Ability: {DivinationCount[killer.PlayerId]}", "Consigliere");
Logger.Info($"{killer.GetNameWithRole()}: Checked -> {target.GetNameWithRole()} || Remaining Ability: {DivinationCount[killer.PlayerId]}", "Consigliere");
Utils.NotifyRoles(SpecifySeer: killer, SpecifyTarget: target, ForceLoop: true);

SendRPC(killer.PlayerId, target.PlayerId);
Expand Down
2 changes: 1 addition & 1 deletion Roles/Impostor/Deathpact.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private static void KillPlayerInDeathpact(PlayerControl deathpact, PlayerControl
}

public override string GetMark(PlayerControl seer, PlayerControl seen, bool isForMeeting = false)
=> IsInDeathpact(seer.PlayerId, seen) ? ColorString(Palette.ImpostorRed, "â—€") : string.Empty;
=> IsInDeathpact(seer.PlayerId, seen) ? ColorString(Palette.ImpostorRed, "") : string.Empty;

public override string GetSuffix(PlayerControl seer, PlayerControl seen, bool isForMeeting = false)
{
Expand Down
2 changes: 1 addition & 1 deletion Roles/Impostor/EvilHacker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public override void OnReportDeadBody(PlayerControl reporter, NetworkedPlayerInf

if (canSeeImpostorMark && entry.NumImpostors > 0)
{
var ImpostorMark = "★".Color(Palette.ImpostorRed);
var ImpostorMark = "".Color(Palette.ImpostorRed);
builder.Append(ImpostorMark);
}

Expand Down
4 changes: 2 additions & 2 deletions Roles/Impostor/EvilTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ public static void ReceiveRPC(MessageReader reader)
}

public override string GetProgressText(byte PlayerId, bool comms)
=> CanTarget(PlayerId) ? Utils.ColorString(Palette.ImpostorRed.ShadeColor(0.5f), "Γùü") : string.Empty;
=> CanTarget(PlayerId) ? Utils.ColorString(Palette.ImpostorRed.ShadeColor(0.5f), "") : string.Empty;

public override string GetMark(PlayerControl seer, PlayerControl seen = null, bool isForMeeting = false)
{
seen ??= seer;
return Target.ContainsValue(seen.PlayerId)
? Utils.ColorString(Palette.ImpostorRed.ShadeColor(0.5f), "ΓùÇ") : string.Empty;
? Utils.ColorString(Palette.ImpostorRed.ShadeColor(0.5f), "") : string.Empty;
}
public override string GetSuffix(PlayerControl seer, PlayerControl seen = null, bool isForMeeting = false)
{
Expand Down
2 changes: 1 addition & 1 deletion Roles/Neutral/Berserker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public override bool OnCheckMurderAsKiller(PlayerControl killer, PlayerControl t

if (BerserkerKillMax[killer.PlayerId] >= BerserkerBomberLevel.GetInt() && BerserkerThreeCanBomber.GetBool())
{
Logger.Info("þé©Õ╝╣þêåþé©õ║å", "Boom");
Logger.Info("Bomb exploded", "Boom");
CustomSoundsManager.RPCPlayCustomSoundAll("Boom");
foreach (var player in Main.AllAlivePlayerControls)
{
Expand Down
2 changes: 1 addition & 1 deletion Roles/Neutral/Executioner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public override string GetMarkOthers(PlayerControl seer, PlayerControl target, b
{
if ((!seer.IsAlive() || seer.Is(CustomRoles.Executioner)) && IsTarget(target.PlayerId))
{
return Utils.ColorString(Utils.GetRoleColor(CustomRoles.Executioner), "♦");
return Utils.ColorString(Utils.GetRoleColor(CustomRoles.Executioner), "");
}
return string.Empty;
}
Expand Down
4 changes: 2 additions & 2 deletions Roles/Neutral/Follower.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ public override string GetMarkOthers(PlayerControl seer, PlayerControl target, b
{
if (!BetTargetKnowFollower.GetBool()) return "";
return (BetPlayer.TryGetValue(target.PlayerId, out var x) && seer.PlayerId == x) ?
Utils.ColorString(Utils.GetRoleColor(CustomRoles.Follower), "♩") : "";
Utils.ColorString(Utils.GetRoleColor(CustomRoles.Follower), "") : "";
}
var GetValue = BetPlayer.TryGetValue(seer.PlayerId, out var targetId);
return GetValue && targetId == target.PlayerId ? Utils.ColorString(Utils.GetRoleColor(CustomRoles.Follower), "♩") : "";
return GetValue && targetId == target.PlayerId ? Utils.ColorString(Utils.GetRoleColor(CustomRoles.Follower), "") : "";
}
public override string GetProgressText(byte playerId, bool coooms)
{
Expand Down
4 changes: 2 additions & 2 deletions Roles/Neutral/Lawyer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ public override string GetMarkOthers(PlayerControl seer, PlayerControl target, b

if ((!seer.IsAlive() || seer.Is(CustomRoles.Lawyer)) && IsTarget(target.PlayerId))
{
return Utils.ColorString(Utils.GetRoleColor(CustomRoles.Lawyer), "♦");
return Utils.ColorString(Utils.GetRoleColor(CustomRoles.Lawyer), "");
}
else if (seer.IsAlive() && TargetKnowsLawyer.GetBool() && IsTarget(seer.PlayerId) && _state.PlayerId == target.PlayerId)
{
return Utils.ColorString(Utils.GetRoleColor(CustomRoles.Lawyer), "♦");
return Utils.ColorString(Utils.GetRoleColor(CustomRoles.Lawyer), "");
}

return string.Empty;
Expand Down
4 changes: 2 additions & 2 deletions Roles/Neutral/PlagueBearer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ public override void AfterMeetingTasks()
CheckPlagueAllPlayers();
}
public override string GetMark(PlayerControl seer, PlayerControl seen, bool isForMeeting = false)
=> IsPlagued(seer.PlayerId, seen.PlayerId) ? ColorString(GetRoleColor(CustomRoles.PlagueBearer), "⊿") : string.Empty;
=> IsPlagued(seer.PlayerId, seen.PlayerId) ? ColorString(GetRoleColor(CustomRoles.PlagueBearer), "⦿") : string.Empty;
public override string GetMarkOthers(PlayerControl seer, PlayerControl target, bool isForMeeting = false)
{
if (playerIdList.Any() && IsPlagued(playerIdList.First(), target.PlayerId) && seer.IsNeutralApocalypse() && seer.PlayerId != playerIdList.First())
{
return ColorString(GetRoleColor(CustomRoles.PlagueBearer), "⊿");
return ColorString(GetRoleColor(CustomRoles.PlagueBearer), "⦿");
}
return string.Empty;
}
Expand Down
2 changes: 1 addition & 1 deletion Roles/Neutral/Shroud.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public override void AfterMeetingTasks()
}

public override string GetMarkOthers(PlayerControl seer, PlayerControl target, bool isMeeting = false)
=> isMeeting && ShroudList.ContainsKey(target.PlayerId) ? Utils.ColorString(Utils.GetRoleColor(CustomRoles.Shroud), "Γùê") : string.Empty;
=> isMeeting && ShroudList.ContainsKey(target.PlayerId) ? Utils.ColorString(Utils.GetRoleColor(CustomRoles.Shroud), "") : string.Empty;

public override void SetAbilityButtonText(HudManager hud, byte playerId)
{
Expand Down

0 comments on commit c2c4893

Please sign in to comment.