public static void Postfix() { if (MeetingHud.Instance == null) { try { if (PlayerControl.AllPlayerControls.Count > 1 && NameColorPatch.hasAnyRole(PlayerControl.LocalPlayer)) { foreach (RoleGenerator role in allRoles) { if (role.NameOfRole == PlayerControl.LocalPlayer.getModdedControl().Role) { PlayerControl.LocalPlayer.nameText.color = role.RoleColor; } } } } catch { } } else { upMetPatch.updateMeetingHUD(MeetingHud.Instance); } }
public static void Postfix() { if (MeetingHud.Instance != null) { upMetPatch.Postfix(MeetingHud.Instance); } else if (ShipStatus.Instance != null) { if (PlayerControl.LocalPlayer.Data.IsImpostor) { PlayerControl.LocalPlayer.nameText.color = Palette.ImpostorRed; } else { PlayerControl.LocalPlayer.nameText.color = Palette.White; } if (PlayerControl.AllPlayerControls.Count > 1 && NameColorPatch.hasAnyRole(PlayerControl.LocalPlayer)) { foreach (RoleGenerator role in allRoles) { if (role.containedPlayerIds.Contains(PlayerControl.LocalPlayer.PlayerId)) { PlayerControl.LocalPlayer.nameText.color = role.RoleColor; } } } } }
public static void updateMeetingHUD(MeetingHud __instance) { foreach (PlayerVoteArea player in __instance.playerStates) { if (player.NameText.text == PlayerControl.LocalPlayer.nameText.text && NameColorPatch.hasAnyRole(PlayerControl.LocalPlayer)) { foreach (RoleGenerator role in allRoles) { if (role.NameOfRole == PlayerControl.LocalPlayer.getModdedControl().Role) { player.NameText.color = role.RoleColor; } } } } }