Skip to main content

Project Plugins

Last Updated Time: 11/27/2023

Overview

This documentation is about managing and creating plugins. Plugins are collections of code and data that can be quickly added or removed by editors. Plugins include engine plugins and project plugins, and they correspond to different purposes. Engine plugins focus on adding or modifying the features of engines and editors. While project plugins are mainly the extension and encapsulation of projects' features.

Plugin Manager

Click Config -> Project Plugins Config in the Editor to open the Project Plugins Config window.

image-20231108174505992

The Project Plugins Config window:

image-20231109094918702

No.NameDescription
1Project Plugin ListContain all the plugins installed in projects and differentiates them by plugin type. You can click on the list to filter plugins by type.
2Search BarPlugins can be searched by name, and the Filter button allows filtering by whether the plugin is enabled or not.
3Plugin Information ListDisplay the basic information of the plugins, including the icon, name, version, author and plugin status (enabled/disabled). You can check/uncheck to switch the enabled/disabled status of the plugin ( Reopening the Editor to take effect).

Click the Edit button at the bottom of the plugin to edit the plugin details.

image-20231108175709914

Creating Plugins

Click File -> Create Plugin to open the Create Plugin window. Select the needed plugin template in the interface, fill in the plugin Name, then click the Create button, and the plugin will be created in the directory location specified by the Path control (This directory is specified by the project configuration file).

Creating engine plugins in the Editor is not supported currently.

Plugin Parsing

Plugin Paths

Engine Plugins: Engine root path/plugins/PluginName

The path of the engine plugin can be modified in the engine_path.json file.

    "name": "EnpginePluginsPath",
"path": "plugins"

Project Plugins: Project root path/plugins/PluginName

Project plugins can be modified in the project's .projectinfo file.

    [Project]
PluginPath=plugins

The Engine will search for the path of the corresponding plugin and finds the plugin through the plugin description file (.plugininfo) in the plugin root path.

Plugin Description Files

[Project]
BinaryPath=bin
ResourcePath=res
ScriptPath=script
SourcePath=source
IsEngine=true
IsExperimental=false
DefaultEnable=true
PluginName=collector
Description=
Author=
Version=1.0
Category=Other
ConfigPath=config

[Module]
fx_collect=1

The fields in the [Project] category describe the basic information about the plugin.

The fields in the [Module] category describe the basic information about the module (under development).

Plugin Directory

bin: The generated binary files

config: Plugin configurations

res: Plugin resources

skin: Interface resources

text: Translation resources

script: Scripts

source: C++ directory

The preview.png files represent the preview images of the plugins with a customizable resolution of 60*60.

Plugin Development

Scripts

Located in the plugin's scripts directory, and can be developed with the Lua IDE. It is recommended to use the VScode + Lua plugin.

C++

Located in the plugin's source directory, and can be developed with the C++ IDE. It is recommended to use VS2015 or VS2019.

Code plugins are loaded by the Engine in the form of dynamic link libraries (.dll).

Dependencies (Under Development)

Note

The arrows indicate possible dependencies, where each plugin type or module type can depend on other plugin type or module type at the same or higher level.

Project Structures (Under Development)

When opening a project, project plugins containing code will be added to the project's plugin folder.

When opening the Engine, engine plugins containing code will be added to the Engine's plugin folder.

Auto Compilation

Dependent project plugin modules are included in the project solution, and when opening the project from launcher, the project solution will be compiled with the dependent project plugins.

The Solution directory is as follows:

Sln/
├─ Engines/
│ ├─ Engine/
├─ Projects/
│ ├─ Plugins/
│ │ ├─ plugin-a
│ │ ├─ plugin-b
│ ├─ Project

If the project plugin is enabled in .projectinfo, the compiled module of the plugin will be generated under Sln/Plugins; at the same time, before the project is compiled, the compilation of the enabled plugin will be triggered.