Add rank prefix and suffix to player name in chat (#3730)
Fixes issue #1721
This commit is contained in:
parent
73a3c4e3be
commit
a0341d561a
@ -11433,6 +11433,26 @@ a_Player:OpenWindow(Window);
|
|||||||
},
|
},
|
||||||
Notes = "Returns the full color code to be used for this player's messages (based on their rank). Prefix player messages with this code.",
|
Notes = "Returns the full color code to be used for this player's messages (based on their rank). Prefix player messages with this code.",
|
||||||
},
|
},
|
||||||
|
GetPrefix =
|
||||||
|
{
|
||||||
|
Returns =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
Type = "string",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Notes = "Returns the prefix to player names for messages (based on their rank), may contain @ format codes.",
|
||||||
|
},
|
||||||
|
GetSuffix =
|
||||||
|
{
|
||||||
|
Returns =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
Type = "string",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Notes = "Returns the suffix to player names for messages (based on their rank), may contain @ format codes.",
|
||||||
|
},
|
||||||
GetCurrentXp =
|
GetCurrentXp =
|
||||||
{
|
{
|
||||||
Returns =
|
Returns =
|
||||||
|
@ -1562,7 +1562,11 @@ void cClientHandle::HandleChat(const AString & a_Message)
|
|||||||
{
|
{
|
||||||
Color.clear();
|
Color.clear();
|
||||||
}
|
}
|
||||||
Msg.AddTextPart(AString("<") + m_Player->GetName() + "> ", Color);
|
Msg.AddTextPart("<");
|
||||||
|
Msg.ParseText(m_Player->GetPrefix());
|
||||||
|
Msg.AddTextPart(m_Player->GetName(), Color);
|
||||||
|
Msg.ParseText(m_Player->GetSuffix());
|
||||||
|
Msg.AddTextPart("> ");
|
||||||
Msg.ParseText(Message);
|
Msg.ParseText(Message);
|
||||||
Msg.UnderlineUrls();
|
Msg.UnderlineUrls();
|
||||||
cRoot::Get()->BroadcastChat(Msg);
|
cRoot::Get()->BroadcastChat(Msg);
|
||||||
|
@ -1828,6 +1828,24 @@ AString cPlayer::GetColor(void) const
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
AString cPlayer::GetPrefix(void) const
|
||||||
|
{
|
||||||
|
return m_MsgPrefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
AString cPlayer::GetSuffix(void) const
|
||||||
|
{
|
||||||
|
return m_MsgSuffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AString cPlayer::GetPlayerListName(void) const
|
AString cPlayer::GetPlayerListName(void) const
|
||||||
{
|
{
|
||||||
const AString & Color = GetColor();
|
const AString & Color = GetColor();
|
||||||
|
@ -285,6 +285,12 @@ public:
|
|||||||
The returned value either is empty, or includes the cChatColor::Delimiter. */
|
The returned value either is empty, or includes the cChatColor::Delimiter. */
|
||||||
AString GetColor(void) const;
|
AString GetColor(void) const;
|
||||||
|
|
||||||
|
/** Returns the player name prefix, may contain @ format directives */
|
||||||
|
AString GetPrefix(void) const;
|
||||||
|
|
||||||
|
/** Returns the player name suffix, may contain @ format directives */
|
||||||
|
AString GetSuffix(void) const;
|
||||||
|
|
||||||
/** Returns the name that is used in the playerlist. */
|
/** Returns the name that is used in the playerlist. */
|
||||||
AString GetPlayerListName(void) const;
|
AString GetPlayerListName(void) const;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user