Struct Badge
Represents an in-game badge.
public struct Badge
- Inherited Members
- Extension Methods
Constructors
Badge(string, string, bool)
Initializes a new instance of the Badge struct.
public Badge(string text, string color, bool isGlobal = false)
Parameters
text
stringThe badge text.
color
stringThe badge color.
isGlobal
boolIndicates whether the badge is global.
Properties
Color
Gets the badge color.
public readonly string Color { get; }
Property Value
IsGlobal
Gets a value indicating whether the badge is global.
public readonly bool IsGlobal { get; }
Property Value
Text
Gets the badge text.
public readonly string Text { get; }
Property Value
Methods
GetHexColor(PlayerInfoColorTypes)
Gets the hex color code of the provided Misc.PlayerInfoColorTypes.
public static string GetHexColor(Misc.PlayerInfoColorTypes colorType)
Parameters
colorType
Misc.PlayerInfoColorTypesThe Misc.PlayerInfoColorTypes to get the hex color code of.
Returns
- string
The hex color code, including the
#
.
IsValidColor(string, out PlayerInfoColorTypes?)
Gets whether the provided hex color code can be used in badges.
public static bool IsValidColor(string hex, out Misc.PlayerInfoColorTypes? colorType)
Parameters
hex
stringThe hex color code, including the
#
.colorType
Misc.PlayerInfoColorTypes?If the method returns true, this will be an enum representing the hex code. If the method returns false, this will be null.
Returns
- bool
Whether the provided hex color code can be used in badges.
ToString()
Returns the Badge in a human-readable format.
public override string ToString()
Returns
- string
A string containing Badge-related data.