Aesthetic changes to the /help command.
This commit is contained in:
parent
494c913fef
commit
d6e1f63529
@ -64,19 +64,22 @@ public class HelpCommand extends VanillaCommand {
|
||||
ChatPaginator.ChatPage page = ChatPaginator.paginate(topic.getFullText(sender), pageNumber, pageWidth, pageHeight);
|
||||
|
||||
StringBuilder header = new StringBuilder();
|
||||
header.append(ChatColor.GREEN);
|
||||
header.append("===== Help: ");
|
||||
header.append(ChatColor.YELLOW);
|
||||
header.append("--------- ");
|
||||
header.append(ChatColor.WHITE);
|
||||
header.append("Help: ");
|
||||
header.append(topic.getName());
|
||||
header.append(" ");
|
||||
if (page.getTotalPages() > 1) {
|
||||
header.append("(");
|
||||
header.append(page.getPageNumber());
|
||||
header.append(" of ");
|
||||
header.append("/");
|
||||
header.append(page.getTotalPages());
|
||||
header.append(") ");
|
||||
}
|
||||
header.append(ChatColor.YELLOW);
|
||||
for (int i = header.length(); i < ChatPaginator.GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH; i++) {
|
||||
header.append("=");
|
||||
header.append("-");
|
||||
}
|
||||
sender.sendMessage(header.toString());
|
||||
|
||||
|
@ -64,8 +64,8 @@ public class IndexHelpTopic extends HelpTopic {
|
||||
line.append(topic.getShortText());
|
||||
|
||||
String lineStr = line.toString().replace("\n", ". ");
|
||||
if (sender instanceof Player && lineStr.length() > ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH) {
|
||||
sb.append(lineStr.substring(0, ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH - 3));
|
||||
if (sender instanceof Player && lineStr.length() > ChatPaginator.GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH) {
|
||||
sb.append(lineStr.substring(0, ChatPaginator.GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH - 3));
|
||||
sb.append("...");
|
||||
} else {
|
||||
sb.append(lineStr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user