add colour for ListConnectedPlayers
also various other minor improvements
This commit is contained in:
parent
196ce87669
commit
d82a75836f
1 changed files with 13 additions and 9 deletions
|
|
@ -5176,16 +5176,24 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
if (invalidUsage)
|
if (invalidUsage)
|
||||||
{
|
{
|
||||||
args.Player.SendErrorMessage("Invalid usage, proper usage: {0}who [-i] [pagenumber]", Specifier);
|
args.Player.SendMessage($"List Online Players Syntax", Color.White);
|
||||||
|
args.Player.SendMessage($"{"playing".Color(Utils.BoldHighlight)} {"[-i]".Color(Utils.RedHighlight)} {"[page]".Color(Utils.GreenHighlight)}", Color.White);
|
||||||
|
args.Player.SendMessage($"Command aliases: {"playing".Color(Utils.GreenHighlight)}, {"online".Color(Utils.GreenHighlight)}, {"who".Color(Utils.GreenHighlight)}", Color.White);
|
||||||
|
args.Player.SendMessage($"Example usage: {"who".Color(Utils.BoldHighlight)} {"-i".Color(Utils.RedHighlight)}", Color.White);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (displayIdsRequested && !args.Player.HasPermission(Permissions.seeids))
|
if (displayIdsRequested && !args.Player.HasPermission(Permissions.seeids))
|
||||||
{
|
{
|
||||||
args.Player.SendErrorMessage("You do not have permission to list player ids.");
|
args.Player.SendErrorMessage("You do not have permission to see player IDs.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
args.Player.SendSuccessMessage("Online Players ({0}/{1})", TShock.Utils.GetActivePlayerCount(), TShock.Config.Settings.MaxSlots);
|
if (TShock.Utils.GetActivePlayerCount() == 0)
|
||||||
|
{
|
||||||
|
args.Player.SendMessage("There are currently no players online.", Color.White);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
args.Player.SendMessage($"Online Players ({TShock.Utils.GetActivePlayerCount().Color(Utils.GreenHighlight)}/{TShock.Config.Settings.MaxSlots})", Color.White);
|
||||||
|
|
||||||
var players = new List<string>();
|
var players = new List<string>();
|
||||||
|
|
||||||
|
|
@ -5194,13 +5202,9 @@ namespace TShockAPI
|
||||||
if (ply != null && ply.Active)
|
if (ply != null && ply.Active)
|
||||||
{
|
{
|
||||||
if (displayIdsRequested)
|
if (displayIdsRequested)
|
||||||
{
|
players.Add($"{ply.Name} (Index: {ply.Index}{(ply.Account != null ? ", Account ID: " + ply.Account.ID : "")})");
|
||||||
players.Add(String.Format("{0} (Index: {1}{2})", ply.Name, ply.Index, ply.Account != null ? ", Account ID: " + ply.Account.ID : ""));
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
players.Add(ply.Name);
|
players.Add(ply.Name);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5209,7 +5213,7 @@ namespace TShockAPI
|
||||||
new PaginationTools.Settings
|
new PaginationTools.Settings
|
||||||
{
|
{
|
||||||
IncludeHeader = false,
|
IncludeHeader = false,
|
||||||
FooterFormat = string.Format("Type {0}who {1}{{0}} for more.", Specifier, displayIdsRequested ? "-i " : string.Empty)
|
FooterFormat = $"Type {Specifier}who {(displayIdsRequested ? "-i" : string.Empty)}{Specifier} for more."
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue