diff --git a/MiraAPI/Hud/CustomPhoneMenu.cs b/MiraAPI/Hud/CustomPhoneMenu.cs index f8a351f..3a9915c 100644 --- a/MiraAPI/Hud/CustomPhoneMenu.cs +++ b/MiraAPI/Hud/CustomPhoneMenu.cs @@ -1,4 +1,6 @@ using AmongUs.GameOptions; +using Il2CppInterop.Runtime.Attributes; +using MiraAPI.Utilities.Assets; using Reactor.Utilities.Extensions; using System; using System.Collections.Generic; @@ -164,4 +166,28 @@ public abstract class CustomPhoneMenu(IntPtr il2CppPtr) : Minigame(il2CppPtr) } protected abstract bool IsEntrySelected(IMenuEntry entry); + + [HideFromIl2Cpp] + protected static void SetNameplateAppearance( + IMenuEntry menuEntry, LoadableAsset? sprite, Color? overColor, Color? unselectedColor) + { + ShapeshifterPanel panel = menuEntry.Panel; + + var nameplate = panel.gameObject.transform.FindChild("Nameplate"); + var highlight = nameplate.FindChild("Highlight").GetComponent(); + var icon = highlight.transform.GetChild(0).GetComponent(); + if (sprite != null) + { + icon.sprite = sprite.LoadAsset(); + } + var button = nameplate.GetComponent(); + if (overColor is { } oColor) + { + button.OverColor = oColor; + } + if (unselectedColor is { } uColor) + { + button.UnselectedColor = uColor; + } + } }