mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
Fix issue #24
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user