forked from Ark2000/PankuConsole
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
255 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,92 @@ | ||
# **Panku Console** | ||
![](https://badgen.net/badge/Godot%20Compatible/4.0.stable%2B/cyan) ![](https://badgen.net/github/release/Ark2000/PankuConsole) | ||
![logo](./docs/assets/logo.png) | ||
|
||
![logo](docs/assets/title.png) | ||
--- | ||
|
||
All-in-One [Godot Engine 4](https://godotengine.org/) runtime debugging tool. | ||
**Panku Console is a feature-packed real-time debugging toolkit for Godot Engine.** With Panku Console, you can easily interact with your scripts and objects at runtime, whether to cheat, debug, prototype, or just to have fun. | ||
|
||
# ✨ **Features** | ||
Panku Console is designed to be modular and extensible, and it is easy to add and maintain features. It is also designed to be as unobtrusive as possible, so you can use it in your project without worrying about the impact on the final product. | ||
|
||
In short, the core function of Panku Console is to dynamically execute some simple expressions while the game is running. Of course, it is much more than that, in fact, Panku Console is a collection of many practical tools. Here is a brief description of its features. | ||
# Features | ||
|
||
✅ **Flexible Multi-window System**. Any windows can be scaled, snapped, dragged and even become an independent os window. | ||
## Multi-window UI | ||
|
||
✅ **Out-of-the-box Developer Console**. No need to define complex commands, enter any expression, execute it and get the result. | ||
Any windows can be scaled, snapped, collapsed, dragged and even become an independent os window. | ||
|
||
✅ **Expression Monitoring**. Create windows to see the results of expressions in real time. | ||
![ui](./docs/assets/ui.png) | ||
|
||
✅ **Quick Key Binding**. Bind expressions to keys for quick cheating. | ||
## Developer Console | ||
|
||
✅ **Popup Notification**. Pop up any message that deserves your attention. | ||
Allows you to execute arbitrary code at runtime like if you were god. | ||
|
||
✅ **Powerful Inspector Generator**. Automatically convert all export properties in your script into an inspector window. | ||
![console](./docs/assets/console.png) | ||
|
||
✅ **History Management**. Manage all your input history, pin or merge history expressions. | ||
## Native Logger | ||
|
||
✅ **Logger System**. Powered by the native file logging system, simple yet powerful. | ||
View native logs (the same as the editor output panel) in an overlay or a separate window. | ||
|
||
![](docs/assets/preview.webp) | ||
![logger](./docs/assets/logger.png) | ||
|
||
# 🧪 **Installation** | ||
## Data Controller | ||
|
||
1. Download [Latest commit](https://github.com/Ark2000/PankuConsole/archive/refs/heads/master.zip) or the stable [Release](https://github.com/Ark2000/PankuConsole/releases) version. | ||
Automatically convert all export properties in your script into an inspector window. | ||
|
||
2. Copy the `addons` folder to your project root directory. | ||
![data_controller](./docs/assets/data_controller.png) | ||
|
||
3. Enable `PankuConsole` in the Godot project addon settings. | ||
## Expression Monitor | ||
|
||
Or if you prefer to use git, you can add this [mirror repo](https://github.com/Ark2000/panku_console) as a submodule in your addons folder. | ||
Watch the results of expressions in real time. | ||
|
||
```bash | ||
# in your project root directory | ||
cd addons | ||
git submodule add https://github.com/Ark2000/panku_console | ||
``` | ||
![expression_monitor](./docs/assets/expression_monitor.png) | ||
|
||
## And More... | ||
|
||
For more information about plugin installation, you can visit the corresponding [Godot documentation](https://docs.godotengine.org/en/stable/tutorials/plugins/editor/installing_plugins.html). | ||
- **History Manager**: view history inputs. | ||
- **Keyboard Shortcut**: bind expressions to keys for quick cheating. | ||
- **Screen Notifier**: display popup messages on the screen. | ||
- **Texture Viewer**: view textures in real time. | ||
|
||
> **Note**: Panku Console only supports Godot version 4.x, and I personally do not plan to provide support for 3.x. | ||
Since Panku Console is modular, you can easily remove or add features to suit your needs. | ||
|
||
# 📚 **Quick Start** | ||
![modular](./docs/assets/modular.png) | ||
|
||
Panku Console is designed to take advantage of Godot's native features as much as possible, to provide as little API as possible, to reduce the intrusiveness of the project, to allow most of the operations to be done at runtime without causing additional burden for the developer, and to use pure GDScript development to maximize applicability and maintenance efficiency. | ||
For more detailed information, please read the following: | ||
|
||
Panku Console is a collection of many tools, and each tool has its own documentation, so I will not go into details here. If you want to know more about the plugin, you can read the following documents. | ||
- [Developer Console](./docs/developer_console.md) | ||
- [Native Logger](./docs/native_logger.md) | ||
- [Data Controller](./docs/data_controller.md) | ||
- [Expression Monitor](./docs/expression_monitor.md) | ||
- [History Manager](./docs/history_manager.md) | ||
- [Keyboard Shortcut](./docs/keyboard_shortcut.md) | ||
- [Texture Viewer](./docs/texture_viewer.md) | ||
- [Misc Commands](./docs/misc_commands.md) | ||
- [General Settings](./docs/general_settings.md) | ||
|
||
**Content:** | ||
# Installation | ||
|
||
- [Interactive Shell](docs/interactive_shell.md) | ||
- [Built-in Commands](docs/builtin_commands.md) | ||
- [Expression Monitor](docs/expression_monitor.md) | ||
- [Expression Shortcut](docs/expression_shortcut.md) | ||
- [Generating Inspector Panel](docs/generating_inspector_panel.md) | ||
- [History Manager](docs/history_manager.md) | ||
- [Logger](docs/logger.md) | ||
- [FAQ](docs/faq.md) | ||
1. Download [Latest commit](https://github.com/Ark2000/PankuConsole/archive/refs/heads/master.zip) from Github | ||
|
||
> **Note**: if you want to include the plugin in your released game, you may need to make some modifications to avoid players directly accessing internal state. | ||
2. Copy the `addons` folder to your project root directory | ||
|
||
# **Contributors** | ||
3. Enable this addon within the Godot settings: `Project > Project Settings > Plugins` | ||
|
||
Thanks to these nice [people who contributed to this project](https://github.com/Ark2000/PankuConsole/graphs/contributors), you can also participate in ways including but not limited to: | ||
Or if you prefer to use git, you can add this [mirror repo](https://github.com/Ark2000/panku_console) as a submodule in your addons folder. | ||
|
||
1. if you find bugs or have any suggestions, you can submit [Issues](https://github.com/Ark2000/PankuConsole/issues) | ||
```bash | ||
# in your project root directory | ||
cd addons | ||
git submodule add https://github.com/Ark2000/panku_console | ||
``` | ||
|
||
For more information about plugin installation, you can visit the corresponding [Godot documentation](https://docs.godotengine.org/en/stable/tutorials/plugins/editor/installing_plugins.html). | ||
|
||
2. if you have questions, you can discuss them in the [Discussion](https://github.com/Ark2000/PankuConsole/discussions) | ||
> **Note**: Panku Console currently only supports Godot version 4.x, 3.x support is still in progress. | ||
3. You can also [Contribute Code](https://github.com/Ark2000/PankuConsole/pulls) directly to this project, please refer to [Recent Commits](https://github.com/Ark2000/PankuConsole/commits/master) for the specification of commit message or [here](https://www.conventionalcommits.org/en/v1.0.0/#summary) | ||
# Contribute | ||
|
||
See [CONTRIBUTING](CONTRIBUTING.md) for more details. | ||
Do you want to contribute? Learn more in [the contribution section](./CONTRIBUTING.md). | ||
|
||
# **License** | ||
# License | ||
|
||
[MIT License](LICENSE) | ||
[MIT License](./LICENSE) | ||
|
||
Copyright (c) 2022-present, Feo (k2kra) Wu | ||
Copyright (c) 2022-present, Feo (k2kra) Wu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Developer Console | ||
|
||
![](./assets/console_window.png) | ||
|
||
The developer console is a tool that allows you to execute arbitrary GD expressions at runtime. You can bring it up by pressing the `~` key in the game by default. It is very useful for debugging and testing. | ||
|
||
The plugin provides a set of predefined objects and they are capable of such as switching full screen, setting game speed, etc. When there is no auto-completion, you can navigate history input by using up and down arrow keys. When there is auto-completion, press the TAB key to fill it automatically. | ||
|
||
> **Note**: This plugin is currently only tested on PC, and has not been tested on mobile platforms. | ||
## What Are Expressions? | ||
|
||
In short, an expression is a set of constants, variables or function calls connected by mathematical operators, such as `interactive_shell.open_window()`, `round(sin(2*PI+1.7*4.2+0.6))`, `null`. | ||
|
||
Expressions are implemented independently of GDScript and have nothing to do with the programming language you are currently using. If you want to know more, you can check the corresponding [Godot documentation](https://docs.godotengine.org/en/stable/tutorials/scripting/evaluating_expressions.html?highlight=expression). | ||
|
||
> **Note**: Statements like `player.hp = 100` are not expressions. If you want to perform an assignment in an expression, you can use the `set` method of `Object`, for example `player.set("hp", 100)`, which is a legal expression. | ||
## Access Your Objects | ||
|
||
By default, the execution environment contains all modules' environment variable, all methods under `@GlobalScope`(such as `print`, `round`, etc.), and some basic class constructors(such as `Vector2()`, `Array()`). | ||
|
||
Your **current scene root** (the last child of `get_tree().root`) will be automatically registered and updated as `current` in the expression execution environment. This means that you can access anything in your scene root script directly, which is very convenient.For example, if you have a `player` variable in your scene root script, you can access it directly in the expression by typing `current.player` or `current.player.hp`. | ||
|
||
All of your **autoload singletons** will be automatically registered at the beginning in the expression execution environment. For example, if you have an `AudioManager` singleton, you can access it directly in the expression by typing `AudioManager`. | ||
|
||
You can also **register your own objects** in the expression execution environment. For example, if you have a `Player` class, you can register it by calling `Panku.gd_exprenv.register_env("player", Player.new())`, and then you can access it directly in the expression by typing `player`. But it's **not recommended** to do this, since it will introduce unnecessary dependencies. | ||
|
||
## About Hinting | ||
|
||
Any methods or properties in user script that **do not begin with an underscore** will be added to the auto-completion system. Optionally, you can add description information to a method or property by defining a string constant named `_HELP_xxx`, `xxx` stands for the corresponding method or property name. | ||
|
||
For example: | ||
|
||
```gdscript | ||
const _HELP_simple_func = "This is a simple function." | ||
func simple_func(): | ||
print("simple func") | ||
``` | ||
|
||
The auto-completion is currently limited to a single property or function, which may be improved later. | ||
|
||
## Change Key Binding | ||
|
||
By default, the developer console is bound to the `toggle_console` action. You can change it in the **input map settings**. | ||
|
||
Currently there's a bug in Godot (See https://github.com/godotengine/godot/issues/25865). You have to add a random input action first to update the input map list, then you can change the default key binding by modifying the `toggle_conosle` action. | ||
|
||
![](./assets/change_key_binding.png) | ||
|
||
## Related Commands | ||
|
||
- `interactive_shell.open_window()` | ||
|
||
Open the developer console window. | ||
|
||
- `interactive_shell.open_launcher()` | ||
|
||
Open the developer console minimized version, which only contains the input box and auto-completion. | ||
|
||
![](./assets/console_launcher.png) | ||
|
||
- `interactive_shell.set_unified_window_visibility(enabled:bool)` | ||
|
||
Set whether all windows' visibility should keep the same as the developer console window. | ||
|
||
- `interactive_shell.set_pause_if_popup(enabled:bool)` | ||
|
||
Set whether the game should pause when the developer console window is opened. | ||
|
||
You can change more settings in [general settings](./general_settings.md). | ||
|
||
## Related Files | ||
|
||
`panku_console/modules/interactive_shell/*` | ||
|
||
`panku_console/modules/variable_tracker/*` |
Oops, something went wrong.