From 22bc8d28ff52bb0d68992cf341b7adb2263eb5cb Mon Sep 17 00:00:00 2001 From: D1GQ Date: Wed, 18 Sep 2024 22:17:42 -0500 Subject: [PATCH] Set color blind text position on ladder --- Patches/ClientPatch.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Patches/ClientPatch.cs b/Patches/ClientPatch.cs index 4dd2684..b343d5f 100644 --- a/Patches/ClientPatch.cs +++ b/Patches/ClientPatch.cs @@ -1,6 +1,7 @@ using HarmonyLib; using InnerNet; using UnityEngine; +using static UnityEngine.GraphicsBuffer; namespace BetterAmongUs.Patches; @@ -116,7 +117,24 @@ public class ClientPatch } __instance.colorBlindText.text = __instance.GetColorBlindText(); __instance.colorBlindText.color = Palette.PlayerColors[color]; - __instance.colorBlindText.transform.localPosition = new Vector3(0f, -1.5f, 0.4999f); + var player = Main.AllPlayerControls.FirstOrDefault(pc => pc.cosmetics == __instance); + + if (player != null) + { + // Set new pos + if (!player.onLadder && !player.MyPhysics.Animations.IsPlayingAnyLadderAnimation()) + { + __instance.colorBlindText.transform.localPosition = new Vector3(0f, -1.5f, 0.4999f); + } + else // Set pos when on a ladder + { + __instance.colorBlindText.transform.localPosition = new Vector3(0f, -1.75f, 0.4999f); + } + } + else // Set new pos if player is null + { + __instance.colorBlindText.transform.localPosition = new Vector3(0f, -1.5f, 0.4999f); + } } catch { }