Module:ProtoFlux/doc

From Resonite Wiki
Revision as of 01:54, 14 January 2024 by Epsilion (talk | contribs) (Expanded documentation on the ProtoFlux UI generator module)

This is the documentation page for Module:ProtoFlux

This is the Lua module for generating ProtoFlux UI elements on pages such as To String (ProtoFlux)

Please note, due to caching, updates made to this module will not immediately take effect on pages using it. If you need to see changes right away, use the editor view of a given page, which will update immediately.

Parameters

Name

Name of this ProtoFlux node. This should be the same as the name you see at the top of a given node in Resonite.

Category

Category for this ProtoFlux node. This is not the full category path, but only the direct parent - it should be the same as what appears at the bottom of a given node in Resonite.

Inputs

A string containing a JSON-encoded array of Name/Type information for each input on this node. Example input might be similar to the following, which adds two inputs of type String, one named Input1 and one named Input2

[{"Name":"Input1", "Type":"String"}, {"Name":"Input2", "Type":"String"}]

Outputs

A string containing a JSON-encoded array of Name/Type information for each output on this node. Example input might be similar to the following, which adds two outputs of type bool, one named Output1 and one named Output2

[{"Name":"Output1", "Type":"bool"}, {"Name":"Output2", "Type":"bool"}]

Globals

A string containing a JSON-encoded array of Name/Type information for each global on this node. Example input might be similar to the following, which adds two inputs of type User, one named Global1 and one named Global2

[{"Name":"Global1", "Type":"User"}, {"Name":"Global2", "Type":"User"}]

Example Usage

If we combine all of the above examples together, we end up with this template invocation:

{{#Invoke:ProtoFlux|GenerateUI
|Name=Example Name
|Category=Example Category
|Inputs=
[{"Name":"Input1", "Type":"String"}, {"Name":"Input2", "Type":"String"}]
|Outputs=
[{"Name":"Output1", "Type":"bool"}, {"Name":"Output2", "Type":"bool"}]
|Globals=
[{"Name":"Global1", "Type":"User"}, {"Name":"Global2", "Type":"User"}]
|}}

which results in the following:

Example Name
Input1
Output1
Input2
Output2
Global1
null
Global2
null
Example Category