(One intermediate revision by one other user not shown)
Line 3:
Line 3:
|Name=Value Option Description Driver`1
|Name=Value Option Description Driver`1
}}
}}
{{stub}}
== Usage ==
The '''ValueOptionDescriptionDriver''' component is used primarily to [[Drive|drive]] the parts that make up a [[Component:ContextMenuItemSource|Context Menu Item Source]]. This component along with ContextMenuItemSource is used in [[Context menu|context menus]] for toggles where the toggle controls a [[Value Type|value]].
|Sprite|{{RootFieldType|RefDrive`1|[[Type:IAssetProvider`1|IAssetProvider`1]]<[[Type:Sprite|Sprite]]>}}|TypeAdv4=true| The Sprite to set to the chosen Sprite in the list of <code>Options</code>.
|DefaultOption|{{RootFieldType|(nested)|[[#Option|ValueOptionDescriptionDriver`1.Option]]<T>}}|TypeAdv7=true| The option to set <code>Label</code>, <code>Color</code>, and <code>Sprite</code> to when <code>Reference</code> doesn't match any <code>ReferenceTarget</code>s under the list of <code>Options</code>.
|Options|{{RootFieldType|SyncList`1|[[#Option|ValueOptionDescriptionDriver`1.Option]]<T>}}|TypeAdv8=true| The list to search for a <code>ReferenceTarget</code> that matches <code>Value</code>. once a match is found, the option's <code>Label</code>, <code>Color</code>, and <code>Sprite</code> is used to drive this section's drive targets of <code>Label</code>, <code>Color</code>, and <code>Sprite</code>.
|SpriteTintBase|ColorX|
|SpriteTintBase|ColorX| Tints the entire sprite with a ColorX.
}}
}}
== Behavior ==
== Option ==
{{Table TypeFields
|ReferenceValue|[[Type:SyncRef`1|SyncRef`1]]<T>|TypeAdv0=true| The values below should be used if <code>Value</code> is equal to this.
|Label|[[Type:String|String]]|TypeAdv1=true| The label to use if <code>ReferenceValue</code> matches <code>Value</code>
|Color|[[Type:ColorX|ColorX]]|TypeAdv2=true| The color to use if <code>ReferenceValue</code> matches <code>Value</code>
|Sprite|[[Type:IAssetProvider`1|IAssetProvider`1]]<[[Type:Sprite|Sprite]]>|TypeAdv3=true| The sprite to use if <code>ReferenceValue</code> matches <code>Value</code>
|SpriteTint|[[Type:ColorX|ColorX]]|TypeAdv4=true|The tint color for this sprite.
}}
== Usage ==
This component can be more efficient than using a bunch of [[Component:ValueEqualityDriver|Value Equality Drivers]] and generating a number based on such, or using [[ProtoFlux]] for a context menu.
[[Category:Components With Nested Types{{#translation:}}|Value Option Description Driver`1]]
[[Category:Components With Nested Types{{#translation:}}|Value Option Description Driver`1]]
[[Category:ComponentStubs]]
Latest revision as of 06:05, 17 March 2025
Component image
Value Option Description Driver`1 component as seen in the Scene Inspector
The ValueOptionDescriptionDriver component is used primarily to drive the parts that make up a Context Menu Item Source. This component along with ContextMenuItemSource is used in context menus for toggles where the toggle controls a value.
The list to search for a ReferenceTarget that matches Value. once a match is found, the option's Label, Color, and Sprite is used to drive this section's drive targets of Label, Color, and Sprite.
This component can be more efficient than using a bunch of Value Equality Drivers and generating a number based on such, or using ProtoFlux for a context menu.