diff options
author | nea <nea@nea.moe> | 2023-02-06 23:43:48 +0100 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-02-06 23:43:48 +0100 |
commit | e32ca7057ebb5a2ee5f86016f76f51829de69247 (patch) | |
tree | b7ff5839313ea72787135e8be954d20cf8bb7985 | |
parent | 5ed0ab3b6d9af0d621e72fcff88c6fe6cd260cf4 (diff) | |
download | NotEnoughUpdates-e32ca7057ebb5a2ee5f86016f76f51829de69247.tar.gz NotEnoughUpdates-e32ca7057ebb5a2ee5f86016f76f51829de69247.tar.bz2 NotEnoughUpdates-e32ca7057ebb5a2ee5f86016f76f51829de69247.zip |
Neu settings autocomplete
-rw-r--r-- | src/main/kotlin/io/github/moulberry/notenoughupdates/commands/help/SettingsCommand.kt | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/help/SettingsCommand.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/help/SettingsCommand.kt index 07d4d203..fe58c807 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/help/SettingsCommand.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/help/SettingsCommand.kt @@ -22,6 +22,7 @@ package io.github.moulberry.notenoughupdates.commands.help import io.github.moulberry.notenoughupdates.NotEnoughUpdates import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe import io.github.moulberry.notenoughupdates.core.GuiScreenElementWrapper +import io.github.moulberry.notenoughupdates.core.config.struct.ConfigProcessor import io.github.moulberry.notenoughupdates.events.RegisterBrigadierCommandEvent import io.github.moulberry.notenoughupdates.options.NEUConfigEditor import io.github.moulberry.notenoughupdates.util.brigadier.* @@ -32,13 +33,16 @@ class SettingsCommand { @SubscribeEvent fun onCommands(event: RegisterBrigadierCommandEvent) { event.command("neu", "neusettings") { - thenArgumentExecute("search", RestArgumentType) { search -> - NotEnoughUpdates.INSTANCE.openGui = GuiScreenElementWrapper( - NEUConfigEditor( - NotEnoughUpdates.INSTANCE.config, - this[search] + thenArgument("search", RestArgumentType) { search -> + suggestsList(ConfigProcessor.create(NotEnoughUpdates.INSTANCE.config).keys.toList()) + thenExecute { + NotEnoughUpdates.INSTANCE.openGui = GuiScreenElementWrapper( + NEUConfigEditor( + NotEnoughUpdates.INSTANCE.config, + this[search] + ) ) - ) + } }.withHelp("Search the NEU settings") thenExecute { NotEnoughUpdates.INSTANCE.openGui = |