Component:AlwaysOnFacetModule

From Resonite Wiki
Revision as of 01:25, 12 January 2024 by Alizard (talk | contribs) (minor spelling error)


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



Introduction

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) Slot List The list of slots currently reparented into the active root.

Behavior

This component only applies to Facets.

When a facet 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 facet, 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 facet, 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