From 00d8ff617d832c50f1c03719bd05313bcc99caa9 Mon Sep 17 00:00:00 2001 From: MASSHUU12 Date: Thu, 11 Jul 2024 12:04:47 +0200 Subject: [PATCH 1/2] docs: update documentation --- addons/yat/docs/BUILTIN_COMMANDS.md | 9 ++-- addons/yat/docs/CREATING_COMMANDS.md | 14 +++--- addons/yat/docs/CUSTOM_WINDOWS.md | 16 +++---- addons/yat/docs/QUICK_COMMANDS.md | 2 +- addons/yat/docs/TERMINAL.md | 10 ++-- addons/yat/docs/USAGE.md | 72 ++++++++++++++-------------- addons/yat/docs/YAT_ENABLE.md | 16 +++---- 7 files changed, 70 insertions(+), 69 deletions(-) diff --git a/addons/yat/docs/BUILTIN_COMMANDS.md b/addons/yat/docs/BUILTIN_COMMANDS.md index 5ffe81e1..994b8037 100644 --- a/addons/yat/docs/BUILTIN_COMMANDS.md +++ b/addons/yat/docs/BUILTIN_COMMANDS.md @@ -1,11 +1,11 @@
-

Builtin commands

-

Here you can find information about builtin commands.

+

Builtin commands

+

Here you can find information about builtin commands.

> [!NOTE] > To disable the built-in command, just comment it out in the [RegisteredCommands](../src/scenes/registered_commands/RegisteredCommands.cs) file in the `RegisterBuiltinCommands` method. - +> > More information about each command can be found in their manuals. | Command | Alias | Description | @@ -20,7 +20,6 @@ | list | lc | List all available commands. | | view | N/A | Changes the rendering mode of the viewport. | | set | N/A | Sets a variable to a value. Does nothing by default, requires adding extensions. | -| watch | N/A | Runs user-defined (not threaded) commands at regular intervals. | | history | hist | Manages the command history of the current session. | | cat | N/A | Prints content of a file. | | cowsay | N/A | Make a cow say something. | @@ -49,3 +48,5 @@ | tfs | N/A | Toggles the full screen mode. | | sr | N/A | Set the screen resolution. | | lcr | N/A | Shows the result of the last command. | + + diff --git a/addons/yat/docs/CREATING_COMMANDS.md b/addons/yat/docs/CREATING_COMMANDS.md index 834d2146..2ab57525 100644 --- a/addons/yat/docs/CREATING_COMMANDS.md +++ b/addons/yat/docs/CREATING_COMMANDS.md @@ -9,21 +9,21 @@ To create a command, you need to create C# file and implement `ICommand` interface with `Command` attribute. -The `Command` attribute accepts the command `name`, and optionally its `description`, `manual` and `aliases`. +The `Command` attribute accepts the command **name**, and optionally its **description**, **manual** and **aliases**. For description and manual, you can also use `Description` and `Usage` attributes. The description and manual/usage have BBCode support. If you do not specify **manual** or **Usage** it'll be automatically generated based on arguments. -The execution of the command begins in the `Execute` method. -The `Execute` method accepts `CommandData`, which contains probably all the things your command could ever need, these are things like: reference to YAT and BaseTerminal, raw arguments & options, converted arguments & options, cancellation token and more. +The execution of the command begins in the **Execute** method. +The **Execute** method accepts **CommandData**, which contains probably all the things your command could ever need, these are things like: reference to YAT and BaseTerminal, raw arguments & options, converted arguments & options, cancellation token and more. -Each created command, at the end of its operation, must return a status and an optional message with which it finished. You can create it yourself, or use one of the static methods of the ICommand interface, such as Success(), or Failure(). +Each created command, at the end of its operation, must return a status and an optional message with which it finished. You can create it yourself, or use one of the static methods of the `ICommand` interface, such as **Success()**, or **Failure()**. > [!NOTE] > Each time a command is called, a new instance of it is created. > -> If you want to maintain state between instances, for example, use static variables. +> If you want to maintain state between instances, you can use static variables. As an example, let's look at Cls command: @@ -52,13 +52,13 @@ public sealed class Cls : ICommand > Using engine features via a command running on a separate thread can be problematic. > > Fortunately, rather most errors can be circumvented by using: -> CallDeferred, CallThreadSafe or CallDeferredThreadGroup. +> **CallDeferred**, **CallThreadSafe** or **CallDeferredThreadGroup**. Creating a command that runs on a separate thread looks very similar to creating a regular command. Therefore, first create a regular command and then add a `Threaded` attribute to it, which allows it to run on a separate thread. -In the passed `CommandData` you can find the `CancellationToken` which indicates when the command was asked to terminate prematurely. +In the passed **CommandData** you can find the **CancellationToken** which indicates when the command was asked to terminate prematurely. ### Overridable methods diff --git a/addons/yat/docs/CUSTOM_WINDOWS.md b/addons/yat/docs/CUSTOM_WINDOWS.md index 31a1d6e1..01ae3b67 100644 --- a/addons/yat/docs/CUSTOM_WINDOWS.md +++ b/addons/yat/docs/CUSTOM_WINDOWS.md @@ -1,26 +1,26 @@
-

Custom windows

-

Here you can find information on creating custom windows for YAT commands.

+

Custom windows

+

Here you can find information on creating custom windows for YAT commands.

### Custom windows YAT internally uses the `YatWindow` node to create windows. -If you want to create your own windows for your commands, I recommend creating them by inheriting from `YatWindow`. +If you want to create your own windows for your commands, it's recommended to create them by inheriting from **YatWindow**. This way, the window will behave similarly to native windows and its appearance will be consistent, plus you will get access to many additional out-of-the-box features. -Any windows should be added to `Yat.Windows` for order and clarity. +Any windows should be added to **Yat.Windows** for order and clarity. You can add your window this way: -```csharp +```cs Yat.Windows.AddChild(_yourWindow); ``` ### Scaling with the main viewport -The `YatWindow` is able to scale to always contain itself in the `main viewport`. -To use this functionality, all you need to do is to use `base._Ready();` in the `_Ready` method of your window. +The **YatWindow** is able to scale to always contain itself in the main viewport. +To use this functionality, all you need to do is to use **base._Ready()** in the **_Ready** method of your window. -Using the variable `ViewportEdgeOffset` you can adjust how much the YatWindow will be smaller than the main viewport. +Using the variable **ViewportEdgeOffset** you can adjust how much the window will be smaller than the main viewport. diff --git a/addons/yat/docs/QUICK_COMMANDS.md b/addons/yat/docs/QUICK_COMMANDS.md index f85ec476..1119c4f9 100644 --- a/addons/yat/docs/QUICK_COMMANDS.md +++ b/addons/yat/docs/QUICK_COMMANDS.md @@ -3,7 +3,7 @@

Quick Commands are user-defined command prompts.

-> Quick Commands are saved in user://yat_qc.tres +> Quick Commands are saved in **user://yat_qc.tres** ### Managing Quick Commands diff --git a/addons/yat/docs/TERMINAL.md b/addons/yat/docs/TERMINAL.md index 4e96d723..95991c63 100644 --- a/addons/yat/docs/TERMINAL.md +++ b/addons/yat/docs/TERMINAL.md @@ -1,6 +1,6 @@
-

Terminal

-

Here you will find information on the operation of the terminal.

+

Terminal

+

Here you will find information on the operation of the terminal.

### Aborting the command @@ -9,13 +9,13 @@ > > Whether and when the command terminates depends on the command and whether it respects the request. -Interrupting a command is possible only if it runs on a `separate thread` (and if its work does not end in a fraction of a second). +Interrupting a command is possible only if it runs on a **separate thread** (and if its work does not end in a fraction of a second). -To terminate the command you must use the keybinding `yat_terminal_interrupt`. +To terminate the command you must use the keybinding **yat_terminal_interrupt**. ### Context menu -YAT uses the keybinding `yat_context_menu` to launch the context menu. +YAT uses the keybinding **yat_context_menu** to launch the context menu. ### Signals diff --git a/addons/yat/docs/USAGE.md b/addons/yat/docs/USAGE.md index 906a6c99..a2495bf4 100644 --- a/addons/yat/docs/USAGE.md +++ b/addons/yat/docs/USAGE.md @@ -1,17 +1,17 @@
-

Usage

-

Here you can find information about using this extension and its basic configuration.

+

Usage

+

Here you can find information about using this extension and its basic configuration.

-## Getting started +### Getting started To get started with YAT, you must first do two things: -### Create C# solution +#### Create C# solution To create a C# solution in your project, you must select `Project > Tools > C# > Create C# solution` in the upper left corner of the window. This is a required action for any project created in C#. -### Configure .csproj +#### Configure .csproj Unfortunately, the official template in the generated .csproj file is inadequate and cannot cope with more advanced projects, and as a result, several improvements need to be made to it. @@ -34,50 +34,50 @@ This is the bare minimum that should be officially generated by Godot: After performing these two actions, you can now compile the project and activate YAT. -## Keybindings +### Keybindings YAT automatically adds the default actions and key bindings needed for the plugin to work properly. -All actions used have the prefix `yat`, so there should be no conflicts with actions specific to your project. +All actions used have the prefix **yat**, so there should be no conflicts with actions specific to your project. You can find all the used actions below. -## YAT +### YAT -- `yat_terminal_toggle` - Toggles the state of the overlay. -- `yat_context_menu` - Allows to call the context menu. -- `yat_terminal_history_next` - Displays the next command from history. -- `yat_terminal_history_previous` - Displays the previous command from history. -- `yat_terminal_interrupt` - Used to stop command working on separate thread. -- `yat_terminal_autocompletion_next` - Used to display next suggestions from autocompletion. -- `yat_terminal_autocompletion_previous` - Used to display previous suggestions from autocompletion. -- `yat_terminal_close_full_window_display` - Used to close full window display. +- `yat_terminal_toggle` - Toggles the state of the overlay. +- `yat_context_menu` - Allows to call the context menu. +- `yat_terminal_history_next` - Displays the next command from history. +- `yat_terminal_history_previous` - Displays the previous command from history. +- `yat_terminal_interrupt` - Used to stop command working on separate thread. +- `yat_terminal_autocompletion_next` - Used to display next suggestions from autocompletion. +- `yat_terminal_autocompletion_previous` - Used to display previous suggestions from autocompletion. +- `yat_terminal_close_full_window_display` - Used to close full window display. -## Example +### Example -- `yat_example_player_move_left` -- `yat_example_player_move_right` -- `yat_example_player_move_forward` -- `yat_example_player_move_backward` +- `yat_example_player_move_left` +- `yat_example_player_move_right` +- `yat_example_player_move_forward` +- `yat_example_player_move_backward` -### Default keybindings +#### Default keybindings -- yat_terminal_toggle: `~` -- yat_terminal_interrupt: `Ctrl + C` -- yat_context_menu: `Right Mouse Button` -- yat_terminal_history_next: `Arrow Down` -- yat_terminal_history_previous: `Arrow Up` -- yat_terminal_autocompletion_next: `Tab` -- yat_terminal_autocompletion_previous: `Shift + Tab` -- yat_terminal_close_full_window_display: `Q` +- yat_terminal_toggle: `~` +- yat_terminal_interrupt: `Ctrl + C` +- yat_context_menu: `Right Mouse Button` +- yat_terminal_history_next: `Arrow Down` +- yat_terminal_history_previous: `Arrow Up` +- yat_terminal_autocompletion_next: `Tab` +- yat_terminal_autocompletion_previous: `Shift + Tab` +- yat_terminal_close_full_window_display: `Q` -#### Example +##### Example -- yat_example_player_move_left: `A` -- yat_example_player_move_right: `D` -- yat_example_player_move_forward: `W` -- yat_example_player_move_backward: `S` +- yat_example_player_move_left: `A` +- yat_example_player_move_right: `D` +- yat_example_player_move_forward: `W` +- yat_example_player_move_backward: `S` -## Script Templates +### Script Templates YAT includes script templates that can be used as a base for creating new classes. They are available from Godot in the `Create Script` window. diff --git a/addons/yat/docs/YAT_ENABLE.md b/addons/yat/docs/YAT_ENABLE.md index d3793d1f..5029216f 100644 --- a/addons/yat/docs/YAT_ENABLE.md +++ b/addons/yat/docs/YAT_ENABLE.md @@ -1,6 +1,6 @@
-

YatEnable

-

Here you can find information on the YatEnable functionality that allows you to restrict access to the terminal.

+

YatEnable

+

Here you can find information on the YatEnable functionality that allows you to restrict access to the terminal.


@@ -9,20 +9,20 @@ If you don't want users to access the terminal, you can easily **block** access Checking whether the requirements to allow access to YAT have been met is done only once during the startup of the plugin. -Requirements can be combined, when one of them is met YAT will become available. +Requirements can be combined, when **one** of them is met YAT will become available. ### File -You can set the terminal to become accessible only if the specified file (default `.yatenable`) is in the `user://` and/or `res://` directory. +You can set the terminal to become accessible only if the specified file (default ".yatenable") is in the **user://** and/or **res://** directory. -### CMD argument +### Terminal argument -The access restriction can also be lifted when the specified argument (default `--yat`) is passed to the executable file. +The access restriction can also be lifted when the specified argument (default "--yat") is passed to the executable file. The argument can be passed this way: -```bash +```sh my_awesome_game -- --yat ``` -Note the two hyphens preceding the argument, without them it won't work. +Note the two hyphens preceding the argument, without them, it won't work because Godot will consume the input. From 9f9e12ea0ec53d99540a0edfa09b04aa24699afc Mon Sep 17 00:00:00 2001 From: MASSHUU12 Date: Thu, 11 Jul 2024 12:05:08 +0200 Subject: [PATCH 2/2] docs: update version plugin to v1.30.0-beta --- CHANGELOG.md | 6 +++--- addons/yat/plugin.cfg | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff8a9730..8ade0893 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,18 +2,18 @@ All notable changes to this project will be documented in this file. -## [Unreleased] +## [1.30.0-beta 2024-07-11] ### Added - 'run' argument to 'qc' command. - 'enum' type. -- HistoryComponent +- HistoryComponent. ### Changed - Reworked type system. -- Updated documentation for automatic input validation. +- Updated documentation. - Changed indentation to spaces. - CommandInputAttribute throws ArgumentException/ArgumentNullException when passed type definition is invalid. diff --git a/addons/yat/plugin.cfg b/addons/yat/plugin.cfg index 10d391e8..2f96189b 100644 --- a/addons/yat/plugin.cfg +++ b/addons/yat/plugin.cfg @@ -3,5 +3,5 @@ name="YAT" description="YAT is an addon that provides a customizable, in-game terminal for your Godot project. Currently in beta." author="MASSHUU" -version="1.29.0-beta" +version="1.30.0-beta" script="Plugin.cs"