mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-20 01:46:19 +00:00
Set color blind text position on ladder
This commit is contained in:
1 parent
44de5dd370
commit
22bc8d28ff
1 file changed
+19
-1
+19
-1
@@ -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 { }
|
||||
|
||||
|
||||
Reference in new issue
Block a user