diff --git a/MiraAPI/Patches/Roles/RoleBehaviourPatch.cs b/MiraAPI/Patches/Roles/RoleBehaviourPatch.cs new file mode 100644 index 0000000..55cc5a5 --- /dev/null +++ b/MiraAPI/Patches/Roles/RoleBehaviourPatch.cs @@ -0,0 +1,25 @@ +using HarmonyLib; +using MiraAPI.Roles; +using UnityEngine; + +namespace MiraAPI.Patches.Roles; + +[HarmonyPatch(typeof(RoleBehaviour))] +public static class RoleBehaviourPatch +{ + /// + /// Update TeamColor text for Mira roles. + /// + [HarmonyPrefix] + [HarmonyPatch(nameof(RoleBehaviour.TeamColor), MethodType.Getter)] + public static bool PrefixTeamColorGetter(RoleBehaviour __instance, ref Color __result) + { + if (__instance is not ICustomRole behaviour) + { + return true; + } + + __result = behaviour.RoleColor; + return false; + } +} \ No newline at end of file