Edit of asset "Game Developer Console" Accepted

Old/Current New/Edit
Title Game Developer Console
Description This Addon provides a flexible in-game developer console system, allowing you to register custom command and execute them during runtime. You can easily add commands with or without parameters, including optional arguments, and provide descriptions and usage examples for each. The console supports toggling visibility, pause the game when opened. The console can be disabled for release builds if not needed. It also include methods to update the settings for the console, such as changing the toggle key or change command colors.

The addon is compatible with Godot 4.4 and above, some breaking changes where introduced in version 0.5. and 0.6.. For detailed usage, examples and updates, visible the GitHub repository.
Addon to add a console to your game, this will allow you to run commands after opening the console.

To add a command simply use

Console.register_custom_command("reload", _reload, [], "Reload current scene")

where reload is a function without parameters.
If you want to parse parameter use

Console.register_custom_command("count_up", _count_up, ["(int) amount to count up"], "Increase the counter", "Command will increase a local counter", ["count_up 1", "count_up 3"])
This adds a command with a single argument, a short and long description and some examples.

You can also make arguments optional, to do so create them like that:
var count_down_command = Command.new("count_down",
_count_down,
[CommandArgument.new(CommandArgument.Type.INT, "amount", "The amount to count down from the current counter", "1")],
"Decrease the internal counter",
"Command will decrease a local counter",
["count_down", "count_down 2", "count_down 5"])
Console.register_command(count_down_command)

or use the "Console.register_custom_strong_command()" method, which uses the "CommandArgument" instead of the packedstring array for arguments.

Always make sure that your optional parameters are at the end of your parameter list, otherwise the command registration will fail.

To unregister it run, this should be done if a node does leave the scene tree.
Console.remove_command("reload")

Other interessting methods

## Change the console settings
## There are more options
Console.update_console_settings(func(settings: ConsoleSettings):
## Set key to toggle console
settings.open_console_key = KEY_F12

## Pause game tree if console does open up
settings.pause_game_if_console_opened = true
)

## Hide console
Console.hide_console()

## Show console
Console.show_console()

## Disable console completely, can be used to remove it on release builds
Console.disable()

## Enable a disabled console
Console.enable()

# BREAKING_CHANGES:
## Version 0.4.0 -> 0.5.0
This version will add some breaking changes, if you create a
command instance you cannot use the packedstring array anymore. Instead
create a new "CommandArgument" providing the type as first parameter,
the name as the second and if needed a description of the parameter as
last. See the example project or readme for more details
Category Tools
License MIT
Repository Provider GitHub
Repository Url https://github.com/XanatosX/godot-game-console
Issues Url https://github.com/XanatosX/godot-game-console/issues
Godot version Godot 4.4
Version String 0.6.1 0.5.0
Download Commit 0da67f2ddb9ffbf7620eb9d2984436d98cd7e201 377123bf6faca536c6c5ae88ca50823ce27bc430
Download Url (Computed) https://github.com/XanatosX/godot-game-console/archive/0da67f2ddb9ffbf7620eb9d2984436d98cd7e201.zip https://github.com/XanatosX/godot-game-console/archive/377123bf6faca536c6c5ae88ca50823ce27bc430.zip
Icon Url https://media.githubusercontent.com/media/XanatosX/godot-game-console/refs/heads/main/images/logo.png