Component:AlwaysOnFacetModule

From Resonite Wiki
Component image 
Always On Facet Module component as seen in the Scene Inspector

The AlwaysOnFacetModule component allows apart of a facet to remain active while the dashboard is closed.



This article or section is a Stub. You can help the Resonite Wiki by expanding it.


Usage

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
_targets list of Slot

Behavior

This component only applies to Facets.

When a Facets is installed in a dashboard, all of the children of a slot containing a AlwaysOnFacetModule are reparented to a Slot outside of the dashboard. This slot is active when the dashboard is closed, otherwise the facet is inactive due to being under an inactive Slot.

Do not manually modify the _targets list, as it is managed during the normal lifetime of the component. Manually modifying the list may cause unexpected behavior.

This will change the hierarchy of the Facets, if you rely on your facet using dynamic variables they may disconnect due to reparenting (many parts of facets are re-parented, be warned).

Avoid putting this above the UIX elements of the Facets, as it will reparent them and they will no longer show up or may break the canvas.

Examples

For creating a taco facet that reports live taco statistics from a WebSockets, and plays an audio clip when a new taco deal is available. In this example the WebSockets and audio output are active sensitive, and will not work when the dashboard is closed without an AlwaysOnFacetModule.

 Taco Facet
   Canvas - (Having the same name helps when debugging)
     Background and Taco pictures
   Logic - (with AlwaysOnFacetModule)
     Taco Facet Logic - (Having the same name helps when debugging)
       ProtoFlux, WebSockets, audio, and other active sensitive content

When installed, the facet is pulled apart into the following, the exact hierarchy is prone to change but this is the general structure.

 Dashboard Root
   AlwaysOnFacetRoot
     Taco Facet Logic
   DashOffset
     ...Many other slots, some of which go inactive when the dashboard is closed...
       Facets
         Taco Facet
           Canvas
             Background and Taco pictures

Related Components