Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
34228dc9
Commit
34228dc9
authored
May 07, 2022
by
Piotr Blecharski
Committed by
Melledy
May 07, 2022
Browse files
Command list with descriptions in handbook
parent
e85eb2f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
.DS_Store
0 → 100644
View file @
34228dc9
File added
src/main/java/emu/grasscutter/command/CommandMap.java
View file @
34228dc9
...
...
@@ -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.
*
...
...
src/main/java/emu/grasscutter/tools/Tools.java
View file @
34228dc9
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment