The BooleanSwitcher component can be used to enable and disable a list of Slots depending on an index in the list.
The BooleanSwitcher component can be used to enable a specified slot from a list of slots.
It does so by driving the Active field of the slots.
It does so by driving the Active field of the slots.
Line 15:
Line 13:
{{Table ComponentFields
{{Table ComponentFields
|AutoAddChildren|Bool| If true, the Targets list will be automatically populated with the child slots of the slot that this component is on.
|AutoAddChildren|Bool| If true, the Targets list will be automatically populated with the child slots of the slot that this component is on.
|Targets|{{RootFieldType|SyncList`1|[[Type:FieldDrive`1|FieldDrive`1]]<[[Type:Bool|Bool]]>}}|TypeAdv1=true| The list of slots of which one will be enabled.
|AutoAddIgnoreTags|{{RootFieldType|SyncFieldList`1|[[Type:String|String]]}}|TypeAdv1=true| Don't auto add a child slot to the list if it has a tag that is in this list.
|Targets|{{RootFieldType|SyncList`1|[[Type:FieldDrive`1|FieldDrive`1]]<[[Type:Bool|Bool]]>}}|TypeAdv2=true| The list of slots of which one will be enabled.
|ActiveIndex|Int| The index of the currently active slot.
|ActiveIndex|Int| The index of the currently active slot.
|ActivationMode|[[#Mode|Mode]]|TypeAdv3=true| Allows for enabling items in <code>Target</code> based on <code>ActiveIndex</code> number.
|ActivationMode|'''[[#Mode|BooleanSwitcher.Mode]]'''|TypeAdv4=true| Allows for enabling items in <code>Target</code> based on <code>ActiveIndex</code> number.
}}
== Sync Delegates ==
{{Table ComponentTriggers
|SetupForChildrenObjects:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Tells the boolean switcher to add all the children slot active fields of it's slot to it's list.
}}
}}
Line 23:
Line 27:
{{Table EnumValues
{{Table EnumValues
|AtIndexOnly|0| Activates only item at <code>ActiveIndex</code>.
|AtIndexOnly|0| Activates only item at <code>ActiveIndex</code>.
|AfterIndex|1| Activates all items after <code>ActiveIndex</code>
|AllButIndex|1| Activates all items except the one at <code>ActiveIndex</code> which will be disabled.
|BeforeIndex|2| Activates all items that are before <code>ActiveIndex</code>.
|IndexAndBefore|2| Activates all items that are before and at <code>ActiveIndex</code>.
|AllButIndex|3| Activates all items except the one at <code>ActiveIndex</code> which will be disabled.
|IndexAndAfter|3| Activates all items at and after <code>ActiveIndex</code>
}}
}}
Line 34:
Line 38:
== Examples ==
== Examples ==
* [https://www.youtube.com/watch?v=F0PhN-VxPEI BooleanSwitcher tutorial] by [[User:ProbablePrime|ProbablePrime]]
* [https://www.youtube.com/watch?v=F0PhN-VxPEI BooleanSwitcher tutorial] by [[User:ProbablePrime|ProbablePrime]]. May be out of date.
The BooleanSwitcher component can be used to enable and disable a list of Slots depending on an index in the list.
It does so by driving the Active field of the slots.