Workbench Plugin – Arma Reforger
Lou Montana (talk | contribs) (Change category) |
Lou Montana (talk | contribs) (Remove tutorial part, Change category to Guidelines) |
||
Line 2: | Line 2: | ||
'''Workbench Plugins''' are script files that can be triggered from within any editor (Resource Browser, World Editor, Script Editor, etc). | '''Workbench Plugins''' are script files that can be triggered from within any editor (Resource Browser, World Editor, Script Editor, etc). | ||
Existing plugins are listed in {{hl| | Existing plugins are listed in {{hl|Data\Scripts\WorkbenchGame}} and are sorted by directories. | ||
{| class="wikitable" | {| class="wikitable" | ||
! Editor | ! Editor | ||
! Directory | ! Directory | ||
! API Class<br>(Module Type) | |||
|- | |- | ||
| Common Plugins | | Common Plugins | ||
| | | {{hl|Data\Scripts\WorkbenchGame}} | ||
| {{n/a}} | |||
|- | |- | ||
| Resource Manager | | Resource Manager | ||
| ResourceManager | | {{hl|Data\Scripts\WorkbenchGame\ResourceManager}} | ||
| {{Link/Enfusion|armaR|ResourceManager}} | |||
|- | |||
| World Editor (Tools and Plugins) | |||
| {{hl|Data\Scripts\WorkbenchGame\WorldEditor}} | |||
| {{Link/Enfusion|armaR|WorldEditor}} | |||
|- | |||
| Particle Editor | |||
| {{n/a}} | |||
| {{n/a}} | |||
|- | |- | ||
| | | Animation Editor | ||
| | | {{n/a}} | ||
| {{n/a}} | |||
|- | |- | ||
| Script Editor | | Script Editor | ||
| ScriptEditor | | {{hl|Data\Scripts\WorkbenchGame\ScriptEditor}} | ||
| {{Link/Enfusion|armaR|ScriptEditor}} | |||
|- | |- | ||
| | | Audio Editor | ||
| | | {{n/a}} | ||
| {{n/a}} | |||
|- | |||
| Behavior Editor | |||
| {{n/a}} | |||
| {{n/a}} | |||
|- | |||
| String Editor | |||
| {{hl|Data\Scripts\WorkbenchGame\LocalizationEditor}} | |||
| {{Link/Enfusion|armaR|LocalizationEditor}} | |||
|- | |||
| Procedural Animation Editor | |||
| {{n/a}} | |||
| {{n/a}} | |||
|} | |} | ||
Line 27: | Line 54: | ||
A '''Tool''' must be named {{hl|Classname'''Tool'''}}, and its file too. | A '''Tool''' must be named {{hl|Classname'''Tool'''}}, and its file too. | ||
=== Plugin === | |||
A plugin inherits from {{hl|WorkbenchPlugin}} and is decorated with a {{hl|WorkbenchPluginAttribute}} attribute which signature is as follow: | A plugin inherits from {{hl|WorkbenchPlugin}} and is decorated with a {{hl|WorkbenchPluginAttribute}} attribute which signature is as follow: | ||
Line 44: | Line 67: | ||
* icon | * icon | ||
* wbModules: to which editors does this plugin apply (e.g {{hl|wbModules {{=}} { "ScriptEditor" }<nowiki/>}}) | * wbModules: to which editors does this plugin apply (e.g {{hl|wbModules {{=}} { "ScriptEditor" }<nowiki/>}}) | ||
* category: the plugins menu entry in which this plugin will find itself (e.g Plugins > Text > TutorialPlugin) | * category: the plugins menu entry in which this plugin will find itself (e.g Plugins > Text > TutorialPlugin){{Feature|informative|{{hl|category}} accepts forward slash {{hl|/}} to create sub-categories.}} | ||
* awesomeFontCode: the FontAwesome icon associated with the plugin (see [https://fontawesome.com/v5/cheatsheet FontAwesome's Cheatsheet]) | * awesomeFontCode: the FontAwesome icon associated with the plugin (see [https://fontawesome.com/v5/cheatsheet FontAwesome's Cheatsheet]) | ||
Line 50: | Line 73: | ||
It can also, but is not mandatory, override the {{hl|Configure}} method to display a settings entry. | It can also, but is not mandatory, override the {{hl|Configure}} method to display a settings entry. | ||
=== Tool === | |||
A tool is a system that allows for direct manipulation with a config panel available on the side. | A tool is a system that allows for direct manipulation with a config panel available on the side. | ||
Line 61: | Line 85: | ||
=== Scripting === | === Scripting === | ||
==== Modules ==== | |||
A plugin has access to the currently loaded game/project resources, but in order to be as adaptable as possible it should also be generic. | A plugin has access to the currently loaded game/project resources, but in order to be as adaptable as possible it should also be generic. | ||
Line 68: | Line 93: | ||
</enforce> | </enforce> | ||
Where {{hl|ModuleType}} can be one of the | Where {{hl|ModuleType}} can be one of the classes listed {{Link|#mw-content-text|at the beginning of this document}}, all children of the {{hl|WBModuleDef}} class). | ||
Each module has obviously a different API - see their classes for more information. | |||
==== Plugins ==== | |||
Other plugins can be accessed through <enforce inline>aWorkbenchModule.GetPlugin(TAG_ClassNamePlugin);</enforce>. | |||
{{GameCategory|armaR|Modding| | {{GameCategory|armaR|Modding|Guidelines|Scripting}} |
Revision as of 16:14, 26 April 2024
Workbench Plugins are script files that can be triggered from within any editor (Resource Browser, World Editor, Script Editor, etc).
Existing plugins are listed in Data\Scripts\WorkbenchGame and are sorted by directories.
Editor | Directory | API Class (Module Type) |
---|---|---|
Common Plugins | Data\Scripts\WorkbenchGame | N/A |
Resource Manager | Data\Scripts\WorkbenchGame\ResourceManager | ResourceManager |
World Editor (Tools and Plugins) | Data\Scripts\WorkbenchGame\WorldEditor | WorldEditor |
Particle Editor | N/A | N/A |
Animation Editor | N/A | N/A |
Script Editor | Data\Scripts\WorkbenchGame\ScriptEditor | ScriptEditor |
Audio Editor | N/A | N/A |
Behavior Editor | N/A | N/A |
String Editor | Data\Scripts\WorkbenchGame\LocalizationEditor | LocalizationEditor |
Procedural Animation Editor | N/A | N/A |
A Plugin must be named ClassnamePlugin, and its file too.
A Tool must be named ClassnameTool, and its file too.
Plugin
A plugin inherits from WorkbenchPlugin and is decorated with a WorkbenchPluginAttribute attribute which signature is as follow:
- name is mandatory: it is the plugin's display name
- description
- shortcut: none (empty string) can be defined, the plugin will then need to be triggered from the Plugin top menu
- icon
- wbModules: to which editors does this plugin apply (e.g wbModules = { "ScriptEditor" })
- category: the plugins menu entry in which this plugin will find itself (e.g Plugins > Text > TutorialPlugin)
- awesomeFontCode: the FontAwesome icon associated with the plugin (see FontAwesome's Cheatsheet)
A plugin must also override either or both Run or RunCommandLine methods in order to have an impact. It can also, but is not mandatory, override the Configure method to display a settings entry.
Tool
A tool is a system that allows for direct manipulation with a config panel available on the side.
A tool inherits from the editor-related class (e.g World Editor: WorldEditorTool) in order to be found in said editor's Tools menu.
It is decorated with a WorkbenchToolAttribute attribute which signature is identical to WorkbenchPluginAttribute (see above).
Scripting
Modules
A plugin has access to the currently loaded game/project resources, but in order to be as adaptable as possible it should also be generic.
Each Workbench module (editor) API can be accessed through the following script:
Where ModuleType can be one of the classes listed at the beginning of this document, all children of the WBModuleDef class).
Each module has obviously a different API - see their classes for more information.
Plugins
Other plugins can be accessed through aWorkbenchModule.GetPlugin(TAG_ClassNamePlugin);.