This commit is contained in:
ang-xd committed 2025-02-15 13:49:38 -05:00
1 parent 7bf35fc8ae
commit 2bb1d41e65
1 file changed
+25
@@ -0,0 +1,25 @@
using HarmonyLib;
using MiraAPI.Roles;
using UnityEngine;
namespace MiraAPI.Patches.Roles;
[HarmonyPatch(typeof(RoleBehaviour))]
public static class RoleBehaviourPatch
{
/// <summary>
/// Update TeamColor text for Mira roles.
/// </summary>
[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;
}
}