This commit is contained in:
Jesse Boyd 2018-04-20 02:17:03 +10:00
parent 02f2572cf5
commit a89bdae93b
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 11 additions and 8 deletions

View File

@ -582,6 +582,9 @@ public class SchematicCommands extends MethodCommands {
color = "&6";
} else {
color = "&a";
System.out.println("Name " + name + " | " + name.lastIndexOf('.'));
if (name.indexOf('.') != -1) name = name.substring(0, name.lastIndexOf('.'));
System.out.println(" -> " + name);
}
} else if (uriStr.startsWith("http://") || uriStr.startsWith("https://")) {
// url
@ -594,17 +597,17 @@ public class SchematicCommands extends MethodCommands {
if (msg.supportsInteraction()) {
if (loaded) {
msg.text("&7[&c-&7]").command(unload + " " + relFilePath).tooltip("Unload this schematic");
msg.text("&7[&c-&7]").command(unload + " " + relFilePath).tooltip("Unload");
} else {
msg.text("&7[&a+&7]").command(loadMulti + " " + relFilePath).tooltip("(WIP) Append this to your clipboard");
msg.text("&7[&a+&7]").command(loadMulti + " " + relFilePath).tooltip("Add to clipboard");
}
if (hasShow) msg.text("&7[&3O&7]").cmdTip(showCmd + " " + args.getJoinedStrings(0) + " " + relFilePath);
if (!isDir) msg.text("&7[&cX&7]").suggestTip("/" + delete + " " + relFilePath);
msg.text(color + relFilePath);
if (!isDir) msg.text("&7[&cX&7]").suggest("/" + delete + " " + relFilePath).tooltip("Delete");
else if (hasShow) msg.text("&7[&3O&7]").command(showCmd + " " + args.getJoinedStrings(0) + " " + relFilePath).tooltip("Show");
msg.text(color + name);
if (isDir) {
msg.cmdTip(list + " " + args.getJoinedStrings(0) + " " + relFilePath);
msg.command(list + " " + args.getJoinedStrings(0) + " " + relFilePath).tooltip("Load");
} else {
msg.cmdTip(loadSingle + " " + relFilePath);
msg.command(loadSingle + " " + relFilePath).tooltip("Load");
}
} else {
msg.text(color).text(name);

View File

@ -632,6 +632,7 @@ public class UtilityCommands extends MethodCommands {
public static void list(File dir, Actor actor, CommandContext args, @Range(min = 0) int page, int perPage, String formatName, boolean playerFolder, RunnableVal3<Message, URI, String> eachMsg) {
AtomicInteger pageInt = new AtomicInteger(page);
List<File> fileList = new ArrayList<>();
if (perPage == -1) perPage = actor instanceof Player ? 12 : 20; // More pages for console
page = getFiles(dir, actor, args, page, perPage, formatName, playerFolder, file -> fileList.add(file));
if (fileList.isEmpty()) {
@ -639,7 +640,6 @@ public class UtilityCommands extends MethodCommands {
return;
}
if (perPage == -1) perPage = actor instanceof Player ? 12 : 20; // More pages for console
int pageCount = (fileList.size() + perPage - 1) / perPage;
if (page < 1) {
BBC.SCHEMATIC_PAGE.send(actor, ">0");