mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
Add more helpers for getting role strings
This commit is contained in:
1 parent
4bdddc6f8a
commit
b62b8ae216
1 file changed
+42
@@ -542,6 +542,48 @@ public static class Helpers
|
|||||||
return role.NiceName;
|
return role.NiceName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string of a <see cref="RoleBehaviour"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="role">The <see cref="RoleBehaviour"/> to find.</param>
|
||||||
|
/// <returns>The <see cref="RoleBehaviour"/>'s intro blurb.</returns>
|
||||||
|
public static string GetRoleIntroBlurb(this RoleBehaviour role)
|
||||||
|
{
|
||||||
|
if (role is ICustomRole custom)
|
||||||
|
{
|
||||||
|
return custom.RoleDescription;
|
||||||
|
}
|
||||||
|
return role.Blurb;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string of a <see cref="RoleBehaviour"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="role">The <see cref="RoleBehaviour"/> to find.</param>
|
||||||
|
/// <returns>The <see cref="RoleBehaviour"/>'s medium description.</returns>
|
||||||
|
public static string GetRoleMedDescription(this RoleBehaviour role)
|
||||||
|
{
|
||||||
|
if (role is ICustomRole custom)
|
||||||
|
{
|
||||||
|
return custom.RoleDescription;
|
||||||
|
}
|
||||||
|
return role.BlurbMed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string of a <see cref="RoleBehaviour"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="role">The <see cref="RoleBehaviour"/> to find.</param>
|
||||||
|
/// <returns>The <see cref="RoleBehaviour"/>'s long description.</returns>
|
||||||
|
public static string GetRoleLongDescription(this RoleBehaviour role)
|
||||||
|
{
|
||||||
|
if (role is ICustomRole custom)
|
||||||
|
{
|
||||||
|
return custom.RoleLongDescription;
|
||||||
|
}
|
||||||
|
return role.BlurbLong;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns whether the <see cref="RoleBehaviour"/> is blacklisted from appearing and spawning. (Only applicable to vanilla roles).
|
/// Returns whether the <see cref="RoleBehaviour"/> is blacklisted from appearing and spawning. (Only applicable to vanilla roles).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in new issue
Block a user