Wip faction display for roles

These need to be their own text object later.
This commit is contained in:
Atony committed 2026-08-19 17:24:54 -05:00
1 parent 6b923cfe01
commit 7c7d184d1f
2 files changed
+13 -2

No files matched your search

+2 -2
View File
@@ -141,14 +141,14 @@ public static class RoleGuidePatches
if (role is ICustomRole customRole)
{
__instance.roleName.text = customRole.RoleName;
__instance.roleDescription.text = customRole.RoleDescription;
__instance.roleDescription.text = $"<size=60%>{customRole.RoleFactionTitle}</size>\n" + customRole.RoleDescription;
__instance.roleIcon.sprite = customRole.Configuration.Icon?.LoadAsset();
__instance.roleCount.text += $" ({customRole.ParentMod.MiraPlugin.GetAbbreviatedModName()})";
}
else
{
__instance.roleName.text = role.NiceName;
__instance.roleDescription.text = role.BlurbMed;
__instance.roleDescription.text = $"<size=60%>{TranslationController.Instance.GetString(role.TeamType is RoleTeamTypes.Crewmate ? StringNames.Crewmate : StringNames.Impostor)}</size>\n" + role.BlurbMed;
__instance.roleIcon.sprite = role.RoleIconColor;
__instance.roleCount.text += " (AU)";
}
+11
View File
@@ -28,6 +28,17 @@ public interface ICustomRole : IOptionable
/// </summary>
string RoleLongDescription { get; }
/// <summary>
/// Gets the faction / alignment of the role. Used in the role guide.
/// </summary>
string RoleFactionTitle => Team switch
{
ModdedRoleTeams.Crewmate => TranslationController.Instance.GetString(StringNames.Crewmate),
ModdedRoleTeams.Impostor => TranslationController.Instance.GetString(StringNames.Impostor),
ModdedRoleTeams.Custom => "Neutral",
_ => "Other",
};
/// <summary>
/// Gets the <see cref="Color"/> of the role.
/// </summary>