fix Chat Notifications, its about time lmao

This commit is contained in:
D1GQ committed 2025-03-29 18:00:00 -05:00
1 parent df041a86ad
commit 3483db6125
2 files changed
+7 -7

No files matched your search

+3 -3
View File
@@ -6,11 +6,11 @@ namespace BetterAmongUs.Patches;
[HarmonyPatch(typeof(ChatNotification))]
internal class ChatNotificationPatch
{
[HarmonyPatch(nameof(ChatNotification.Update))]
[HarmonyPatch(nameof(ChatNotification.SetUp))]
[HarmonyPostfix]
internal static void Update_Postfix(ChatNotification __instance)
internal static void SetUp_Postfix(ChatNotification __instance)
{
__instance.GetComponent<AspectPosition>().DistanceFromEdge = new Vector3(-2.8f, 0.3f, -40f);
__instance.transform.localScale = new Vector3(0.45f, 0.42f);
__instance.transform.localScale = new Vector3(0.45f, 0.42f, 1f);
}
}
+4 -4
View File
@@ -198,8 +198,8 @@ internal class ClientPatch
}
else if (!client.IsReady)
{
int readyClients = clients.Count(c => c.IsReady);
int totalClients = clients.Length;
int readyClients = clients.Count(c => c?.Character != null && c.IsReady);
int totalClients = clients.Count(c => c?.Character != null);
loadingText = $"Waiting for Players ({readyClients}/{totalClients})";
progress = 0.8f + (0.2f * readyClients / Mathf.Max(1, totalClients));
@@ -252,8 +252,8 @@ internal class ClientPatch
}
else
{
int readyClients = clients.Count(c => c.IsReady);
int totalClients = clients.Length;
int readyClients = clients.Count(c => c?.Character != null && c.IsReady);
int totalClients = clients.Count(c => c?.Character != null);
loadingText = $"Waiting for Players ({readyClients}/{totalClients})";
progress = 0.85f + (0.15f * readyClients / Mathf.Max(1, totalClients));