From 43f92d4dc28fde13db2a9af874bedef864466f76 Mon Sep 17 00:00:00 2001 From: Atony <75191600+AtonyGit@users.noreply.github.com> Date: Sat, 25 Oct 2025 12:17:44 -0500 Subject: [PATCH] Standadize button position --- MiraAPI/Patches/HudManagerPatches.cs | 2 ++ MiraAPI/Patches/PlayerControlPatches.cs | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/MiraAPI/Patches/HudManagerPatches.cs b/MiraAPI/Patches/HudManagerPatches.cs index 03657d0..adc0fc5 100644 --- a/MiraAPI/Patches/HudManagerPatches.cs +++ b/MiraAPI/Patches/HudManagerPatches.cs @@ -112,6 +112,8 @@ public static class HudManagerPatches Error($"Failed to create custom button {button.GetType().Name}: {e}"); } } + __instance.ImpostorVentButton.transform.SetParent(null); + __instance.ImpostorVentButton.transform.SetParent(BottomRight.transform); gridArrange.Start(); gridArrange.ArrangeChilds(); diff --git a/MiraAPI/Patches/PlayerControlPatches.cs b/MiraAPI/Patches/PlayerControlPatches.cs index 954fd45..659c52f 100644 --- a/MiraAPI/Patches/PlayerControlPatches.cs +++ b/MiraAPI/Patches/PlayerControlPatches.cs @@ -127,17 +127,19 @@ internal static class PlayerControlPatches return; } + var role = __instance.Data?.Role; foreach (var button in CustomButtonManager.CustomButtons) { - if (__instance.Data?.Role == null) + if (role == null) { continue; } try { - if (!button.Enabled(__instance.Data?.Role)) + if (!button.Enabled(role)) { + button.SetActive(false, role); continue; }