Reorganized files, started splitting up unit
This commit is contained in:
15
scripts/debug/console_commands/help_command.gd
Normal file
15
scripts/debug/console_commands/help_command.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
class_name HelpCommand extends ConsoleCommand
|
||||
|
||||
func get_command_name() -> String:
|
||||
return "help"
|
||||
|
||||
func get_help_text() -> String:
|
||||
return "Lists all available commands"
|
||||
|
||||
func run(_args: Array, context: Dictionary) -> String:
|
||||
var commands: Array = context["commands"]
|
||||
var lines: PackedStringArray = []
|
||||
for command: ConsoleCommand in commands:
|
||||
lines.append("%s - %s" % [command.get_command_name(), command.get_help_text()])
|
||||
lines.append("Any other input is evaluated as a GDScript expression.")
|
||||
return "\n".join(lines)
|
||||
Reference in New Issue
Block a user