Fix chat over heads, thanks Inanzen for the tip months ago!
This commit is contained in:
parent
f55eaa3caf
commit
0ed25ebbfe
2 changed files with 7 additions and 4 deletions
|
|
@ -171,7 +171,7 @@ namespace TShockAPI
|
||||||
"Changes ingame chat format: {0} = Group Name, {1} = Group Prefix, {2} = Player Name, {3} = Group Suffix, {4} = Chat Message"
|
"Changes ingame chat format: {0} = Group Name, {1} = Group Prefix, {2} = Player Name, {3} = Group Suffix, {4} = Chat Message"
|
||||||
)] public string ChatFormat = "{1}{2}{3}: {4}";
|
)] public string ChatFormat = "{1}{2}{3}: {4}";
|
||||||
|
|
||||||
[Description("Change the chat format when using chat above heads. This begins with a player name wrapped in brackets, as per Terraria's formatting. Same formatting as ChatFormat.")] public string ChatAboveHeadsFormat = "{4}";
|
[Description("Change the player name when using chat above heads. This begins with a player name wrapped in brackets, as per Terraria's formatting. Same formatting as ChatFormat(minus the text).")] public string ChatAboveHeadsFormat = "{2}";
|
||||||
|
|
||||||
[Description("Force the world time to be normal, day, or night.")] public string ForceTime = "normal";
|
[Description("Force the world time to be normal, day, or night.")] public string ForceTime = "normal";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -966,9 +966,12 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Utils.Broadcast(args.Who,
|
string name = Main.player[args.Who].name;
|
||||||
String.Format(Config.ChatAboveHeadsFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix,
|
Main.player[args.Who].name = String.Format(Config.ChatAboveHeadsFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix);
|
||||||
args.Text), tsplr.Group.R, tsplr.Group.G, tsplr.Group.B);
|
NetMessage.SendData((int)PacketTypes.PlayerInfo, -1, -1, Main.player[args.Who].name, args.Who, 0, 0, 0, 0);
|
||||||
|
Main.player[args.Who].name = name;
|
||||||
|
Utils.Broadcast(args.Who, args.Text, tsplr.Group.R, tsplr.Group.G, tsplr.Group.B);
|
||||||
|
NetMessage.SendData((int)PacketTypes.PlayerInfo, -1, -1, name, args.Who, 0, 0, 0, 0);
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue