From 6b923cfe01f3add41205d8c74f6f92e92a97f29e Mon Sep 17 00:00:00 2001 From: Atony <75191600+AtonyGit@users.noreply.github.com> Date: Wed, 19 Aug 2026 17:10:41 -0500 Subject: [PATCH] Show nameplate on player list menu --- MiraAPI/Patches/RoleGuidePatches.cs | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/MiraAPI/Patches/RoleGuidePatches.cs b/MiraAPI/Patches/RoleGuidePatches.cs index 8ddfd00..5f9ab98 100644 --- a/MiraAPI/Patches/RoleGuidePatches.cs +++ b/MiraAPI/Patches/RoleGuidePatches.cs @@ -1,6 +1,7 @@ using System.Globalization; using System.Linq; using HarmonyLib; +using Innersloth.Assets; using MiraAPI.Roles; using MiraAPI.Utilities; using UnityEngine; @@ -99,6 +100,40 @@ public static class RoleGuidePatches } [HarmonyPrefix] [HarmonyPriority(Priority.First)] + [HarmonyPatch(typeof(MatchInfoGuide), nameof(MatchInfoGuide.CreatePlayerEntries))] + private static bool CreatePlayerEntries(MatchInfoGuide __instance) + { + __instance.PlayerPool.ReclaimAll(); + int num = 51; + foreach (NetworkedPlayerInfo networkedPlayerInfo in GameData.Instance.AllPlayers) + { + PlayerIdentifierButton component = + __instance.PlayerPool.Get().GetComponent(); + component.transform.localPosition = new Vector3(0f, 0f, -1f); + component.Populate(networkedPlayerInfo); + __instance.ControllerSelectable.Add(component.Button); + component.SetTextStencil(num++); + component.PlatformIdentifier.transform.localPosition = new Vector3(0.314f, 0.088f, -2.78f); + component.NameText.transform.localPosition = new Vector3(0.3563f, 0, -2.98f); + component.NameText.text += $"\n{networkedPlayerInfo.GetPlayerColorString()}"; + var namePlate = HatManager.Instance.GetNamePlateById(networkedPlayerInfo.DefaultOutfit.NamePlateId); + var x = (NamePlateViewData viewdata) => + { + component.buttonSprite.sprite = viewdata?.Image; + component.buttonSprite.transform.localScale = new Vector3(0.7f, 1.075f, 1); + component.buttonSprite.transform.localPosition = new Vector3(-0.395f, 0, 0.1f); + }; + __instance.StartCoroutine( + AddressableAssetExtensions.CoLoadAssetAsync( + __instance, + namePlate.GetAssetReference(), + x)); + } + + return false; + } + [HarmonyPrefix] + [HarmonyPriority(Priority.First)] [HarmonyPatch(typeof(MatchInfoRolePanel), nameof(MatchInfoRolePanel.SetPanel))] public static bool SetPanel(MatchInfoRolePanel __instance, RoleBehaviour role, int numPerGame, int chancePerGame) {