mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 17:51:53 +00:00
Command list with descriptions in handbook
This commit is contained in:
parent
e85eb2f48a
commit
34228dc9cd
@ -79,6 +79,12 @@ public final class CommandMap {
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<Command> getAnnotationsAsList() { return new LinkedList<>(this.annotations.values()); }
|
||||
|
||||
public HashMap<String, Command> getAnnotations() {
|
||||
return new LinkedHashMap<>(this.annotations);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all registered commands.
|
||||
*
|
||||
|
@ -13,16 +13,15 @@ import java.io.PrintWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import emu.grasscutter.GameConstants;
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.command.Command;
|
||||
import emu.grasscutter.command.CommandMap;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.ResourceLoader;
|
||||
import emu.grasscutter.data.def.AvatarData;
|
||||
@ -111,7 +110,21 @@ final class ToolsWithLanguageOption {
|
||||
|
||||
writer.println("// Grasscutter " + GameConstants.VERSION + " GM Handbook");
|
||||
writer.println("// Created " + dtf.format(now) + System.lineSeparator() + System.lineSeparator());
|
||||
|
||||
|
||||
CommandMap cmdMap = new CommandMap(true);
|
||||
List<Command> cmdList = new ArrayList<>(cmdMap.getAnnotationsAsList());
|
||||
|
||||
writer.println("// Commands");
|
||||
for (Command cmd : cmdList) {
|
||||
String cmdName = cmd.label();
|
||||
while (cmdName.length() <= 15) {
|
||||
cmdName = " " + cmdName;
|
||||
}
|
||||
writer.println(cmdName + " : " + cmd.description());
|
||||
}
|
||||
|
||||
writer.println();
|
||||
|
||||
list = new ArrayList<>(GameData.getAvatarDataMap().keySet());
|
||||
Collections.sort(list);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user