You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,12 +6,55 @@ To learn how to add and remove custom commands please checkout the example [scri
6
6
7
7
I do know there is a addon like this already in development, check it out at the end of this readme. I still wanted to create my own interpretation of this used in games I created. But as I already developed it I decided to make it public and give something back to the Godot developer community.
To install the addon download the source files and put the "addons" folder on a root level to your project. After that enable the plugin via the Godot plugin menu.
12
15
13
16
Checkout this part of the [Godot documentation][installing-and-enable-plugin]
14
17
18
+
## Quickstart
19
+
20
+
### Register a command
21
+
22
+
```gdscript
23
+
Console.register_custom_command("reload", _reload, [], "Reload current scene")
24
+
25
+
func _reload() -> String:
26
+
get_tree().reload_current_scene()
27
+
return "reloaded scene"
28
+
```
29
+
30
+
### Unregister a command
31
+
32
+
```gdscript
33
+
Console.remove_command("reload")
34
+
```
35
+
36
+
### Other important Options
37
+
38
+
```gdscript
39
+
## Set toggle key
40
+
Console.set_console_key(KEY_F12)
41
+
42
+
## Hide console
43
+
Console.hide_console()
44
+
45
+
## Show console
46
+
Console.show_console()
47
+
48
+
## Pause game tree if console does open up
49
+
Console.should_pause_on_open()
50
+
51
+
## Disable console completely, can be used to remove it on release builds
52
+
Console.disable()
53
+
54
+
## Enable a disabled console
55
+
Console.enable()
56
+
```
57
+
15
58
## Example Project
16
59
17
60
I added a test and example project to this addon so you can check out the console in action. The example is not much but does show the usage in a really basic manner.
0 commit comments