Style help entry

This commit is contained in:
Jesse Boyd 2017-04-10 13:33:43 +10:00
parent b4b7a2785f
commit 554eae1fcf
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 16 additions and 12 deletions

View File

@ -215,6 +215,8 @@ public enum BBC {
COMMAND_INVALID_SYNTAX("The command was not used properly (no more help available).", "WorldEdit.Command"),
HELP_HEADER_CATEGORIES("Command Types", "WorldEdit.Help"),
HELP_ITEM_ALLOWED("&a%s0&8 - &7%s1", "WorldEdit.Help"),
HELP_ITEM_DENIED("&c%s0&8 - &7%s1", "WorldEdit.Help"),
HELP_HEADER("Help: page %s0/%s1", "WorldEdit.Help"),
HELP_HEADER_FOOTER("&7Use: &8//help [type|command] [#]&7\n&7Wiki: https://git.io/vSKE5", "WorldEdit.Help"),

View File

@ -649,7 +649,9 @@ public class UtilityCommands {
StringBuilder builder = new StringBuilder();
boolean first = true;
for (Map.Entry<String, ArrayList<CommandMapping>> entry : grouped.entrySet()) {
message.append("&a/" + cmd + " " + entry.getKey() + "&8 - &7" + entry.getValue().size() + "\n");
String s1 = "&a/" + cmd + " " + entry.getKey();
String s2 = entry.getValue().size() + "";
message.append(BBC.HELP_ITEM_ALLOWED.format(s1, s2) + "\n");
}
message.append(BBC.HELP_HEADER_FOOTER.s());
actor.print(BBC.color(message.toString()));
@ -677,21 +679,21 @@ public class UtilityCommands {
// Add each command
for (CommandMapping mapping : list) {
CommandCallable c = mapping.getCallable();
boolean perm = c.testPermission(locals);
// String primary = BBC.color(perm ? "&2" : "&4");
String color = BBC.color(perm ? "&a" : "&c");
message.append(color);
StringBuilder s1 = new StringBuilder();
if (isRootLevel) {
message.append("/");
s1.append("/");
}
if (!visited.isEmpty()) {
message.append(Joiner.on(" ").join(visited));
message.append(" ");
s1.append(Joiner.on(" ").join(visited));
s1.append(" ");
}
s1.append(mapping.getPrimaryAlias());
String s2 = mapping.getDescription().getDescription();
if (c.testPermission(locals)) {
message.append(BBC.HELP_ITEM_ALLOWED.format(s1, s2) + "\n");
} else {
message.append(BBC.HELP_ITEM_DENIED.format(s1, s2) + "\n");
}
message.append(mapping.getPrimaryAlias());
message.append("&8 - &7");
message.append(mapping.getDescription().getDescription());
message.append('\n');
}
message.append(BBC.HELP_HEADER_FOOTER.f());
}