Component:AlwaysOnFacetModule: Difference between revisions

From Resonite Wiki
m minor spelling error
almost every link was spelled wrong lol. A quick few searches later it's fixed.
Line 17: Line 17:
This component only applies to [[Facets]].
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]].
When a [[Facets]] is installed in a [[Dash Menu|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 [[Dash Menu|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.
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).
This will change the hierarchy of the [[Facets]], if you rely on your facet using [[Dynamic Variables|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.
Avoid putting this above the [[UIX|UIX elements]] of the [[Facets]], as it will reparent them and they will no longer show up or may break the canvas.


<!--T:5-->
<!--T:5-->
== Examples ==
== 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.
For creating a taco facet that reports live taco statistics from a [[WebSocket|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.
In this example the [[WebSocket|WebSockets]] and audio output are active sensitive, and will not work when the dashboard is closed without an AlwaysOnFacetModule.


   Taco Facet
   Taco Facet
Line 35: Line 35:
     Logic - (with AlwaysOnFacetModule)
     Logic - (with AlwaysOnFacetModule)
       Taco Facet Logic - (Having the same name helps when debugging)
       Taco Facet Logic - (Having the same name helps when debugging)
         [[ProtoFlux]], [[WebSockets]], audio, and other active sensitive content
         [[ProtoFlux]], [[WebSocket|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.
When installed, the facet is pulled apart into the following, the exact hierarchy is prone to change but this is the general structure.

Revision as of 18:49, 18 January 2024


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 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