Skip to content

uiCombo: Custom Value Possible? (Workaround) #631

Closed Answered by unityconstruct
unityconstruct asked this question in Q&A
Discussion options

You must be logged in to vote

CtrlrCombo Integration Workaround

Provides custom value assignments in a CtrlrCombo object

Summary

  • uiComboList displays a list of options to choose from but will only return a 0-based index of the option selected.
  • The FIRST item in the list will return 0, the SECOND = 1, etc
  • This implementation leverages a
    1. 'token parser' to extract value from selected item's text
    2. Enum/HashTable to translate value to its index in the ComboList
  • Example: Clicking the LAST option will return [3]
#0 = | [0] - Off
#1 = | [1] - FilterSweep
#2 = | 3 = Formant
#3 = | [9] - Notched
  • no user-assignable mapping is possible.

Getting value from a selection

-- Fetch selected text
local text = L(panel:getModulator(

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by unityconstruct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant