Component:ActiveUserCloudField: Difference between revisions

From Resonite Wiki
m ProbablePrime moved page ActiveUserCloudField (Component) to Component:ActiveUserCloudField: Creating component Namespace
m →‎See Also: fix link ooops
 
(3 intermediate revisions by 2 users not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
{{stub}}
{{Infobox Component
{{Infobox Component
|Image=ActiveUserCloudField`1Component.png
|Image=ActiveUserCloudField`1Component.png
|Name=Active User Cloud Field`1
|Name=Active User Cloud Field<T>
}}
}}
The '''ActiveUserCloudField''' Component binds to the [[Type:IField`1|field]] specified by <code>Target</code>. If <code>IsLinkedToCloud</code> is true, it will write the value of the [[Cloud_Variables| cloud variable]] defined by <code>Path</code> for the [[ProtoFlux:Get Active User|active user]] of the slot it is attached to.


<!--T:2-->
<!--T:2-->
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|Path|String|
|Path|String| The [[Cloud_Variables#Cloud_Variable_Definition| path]] of the variable this component will read, for the current [[Active_User|active user]]
|IsLinkedToCloud|Bool|
|IsLinkedToCloud|Bool| ''(Read Only))'' Indicates whether this field was successfully bound to the target variable.
|UpdateCloudVariable|Bool|
|UpdateCloudVariable|Bool| Indicates that this variable should update the value in the cloud when it is written or driven to a different value.
|FallbackValue|Float|
|FallbackValue|'''T'''|TypeAdv3=true| Default value if there is no current active user. If the active user's value isn't set, the definition default will be used instead.
|Target|IField`1|TypeString4=IField<float>|
|Target|{{RootFieldType|RelayRef`1|[[Type:IField`1|IField`1]]&lt;T&gt;}}|TypeAdv4=true| The target [[Type:IField`1| field]] to which the variable value will be written.
}}
}}


<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
For this component to function, the  [[Cloud_Variables#Permissions| cloud variable permissions]] must be set to something suitably permissive for it to function properly.
* If the variable should update on the cloud when a user interacts with the object in some way, '''Write Permissions''' should be set to one of the following:
** variable_owner_unsafe
** variable_owner_only_contacts_unsafe <sup>1</sup>
** Anyone <sup>2</sup>


<!--T:4-->
<!--T:4-->
* If the variable should update on the cloud when a user interacts with the object in some way, '''Read Permissions''' should be set to one of the following:
** variable_owner_unsafe
** variable_owner_only_contacts_unsafe <sup>3</sup>
** Anyone <sup>4</sup>
<sub>
1. This permission results in only contacts of the variable owner being able to change a value. It also allows contacts to change each others values, which may not be desired.
<br>
2. This permission is only valid for group variable definitions, and allows anyone to write the value of anyone else, which might have unintended consequences.
<br>
3. This permission results in only contacts of the variable owner being able to read a value, however the value is read by the active user and synced normally to everyone else in a session, making this detail irrelevant.
<br>
4. This permission is only valid for group variable definitions, and allows anyone to read the value of anyone else, however the value is read by the active user and synced normally to everyone else in a session, making this detail irrelevant.
</sub>
<!--T:5-->
== Examples ==
== Examples ==
Having an item where it changes to the user's color set on the cloud.


<!--T:5-->
<!--T:6-->
== Related Components ==
== See Also ==
* [[Component:ActiveUserCloudValueVariable]]
</translate>
</translate>
[[Category:ComponentStubs]]
[[Category:Generics{{#translation:}}]]
[[Category:Generics{{#translation:}}]]
[[Category:Components{{#translation:}}|Active User Cloud Field`1]]
[[Category:Components{{#translation:}}|Active User Cloud Field`1]]
[[Category:Generic Components{{#translation:}}|Active User Cloud Field`1]]
[[Category:Components:Cloud:Variables{{#translation:}}|Active User Cloud Field`1]]
[[Category:Components:Cloud:Variables{{#translation:}}|Active User Cloud Field`1]]

Latest revision as of 11:30, 11 November 2024

Component image 
Active User Cloud Field<T> component as seen in the Scene Inspector

The ActiveUserCloudField Component binds to the field specified by Target. If IsLinkedToCloud is true, it will write the value of the cloud variable defined by Path for the active user of the slot it is attached to.

Fields

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.
Path String The path of the variable this component will read, for the current active user
IsLinkedToCloud Bool (Read Only)) Indicates whether this field was successfully bound to the target variable.
UpdateCloudVariable Bool Indicates that this variable should update the value in the cloud when it is written or driven to a different value.
FallbackValue T Default value if there is no current active user. If the active user's value isn't set, the definition default will be used instead.
Target direct RelayRef`1<IField`1<T>> The target field to which the variable value will be written.

Usage

For this component to function, the cloud variable permissions must be set to something suitably permissive for it to function properly.

  • If the variable should update on the cloud when a user interacts with the object in some way, Write Permissions should be set to one of the following:
    • variable_owner_unsafe
    • variable_owner_only_contacts_unsafe 1
    • Anyone 2
  • If the variable should update on the cloud when a user interacts with the object in some way, Read Permissions should be set to one of the following:
    • variable_owner_unsafe
    • variable_owner_only_contacts_unsafe 3
    • Anyone 4

1. This permission results in only contacts of the variable owner being able to change a value. It also allows contacts to change each others values, which may not be desired.
2. This permission is only valid for group variable definitions, and allows anyone to write the value of anyone else, which might have unintended consequences.
3. This permission results in only contacts of the variable owner being able to read a value, however the value is read by the active user and synced normally to everyone else in a session, making this detail irrelevant.
4. This permission is only valid for group variable definitions, and allows anyone to read the value of anyone else, however the value is read by the active user and synced normally to everyone else in a session, making this detail irrelevant.

Examples

Having an item where it changes to the user's color set on the cloud.

See Also