Skip to content

SoundDropdown

R41z0r edited this page Jun 13, 2026 · 2 revisions

Contents

SoundDropdown stores one sound value and can preview sounds through a custom resolver, custom playback function, or LibSharedMedia lookup.

Field Type Description
soundResolver function Converts stored value to playable sound.
previewSoundFunc function Custom preview playback.
previewTooltip string Tooltip text for preview button.
playbackChannel string Sound channel, e.g. "Master".
getPlaybackChannel function Dynamic channel provider.
placeholderText string Empty selection text.
menuHeight number Dropdown menu height.
app:RegisterControl("sounds.alerts", {
  id = "readySound",
  key = "readySound",
  type = "sounddropdown",
  label = "Ready sound",
  placeholderText = NONE or "None",
  playbackChannel = "Master",
  previewTooltip = "Preview this sound.",
  soundResolver = function(value)
    return MyAddon.ResolveSound(value)
  end,
  previewSoundFunc = function(value)
    MyAddon.PlaySound(value)
  end,
})

The preview button tries, in order:

  1. previewSoundFunc
  2. soundResolver
  3. LibSharedMedia-3.0 sound lookup
  4. Raw stored value

Wiki
  • Home
  • Architecture
  • Vendoring
  • Quick Start
  • Field Glossary
  • Troubleshooting
  • Validation

Reference
  ⚬ Config API
  ⚬ UI API
  ⚬ Elements
  ⚬ Examples

Elements
  Structure
   • Category
   • Page
   • Group
   • Dashboard
   • InfoPage
   • Custom
  Controls
   • Toggle
   • CheckboxDropdown
   • Dropdown
   • MultiDropdown
   • SoundDropdown
   • Input
   • Slider
   • Button
  Advanced
   • ColorPicker
   • ColorPalette
   • ColorOverrides
   • ReorderList
   • Expandable
   • Notes

Examples
  Start
   • Minimal Addon
   • Complete Settings Center
   • Wrapper Bridge Pattern
  Data and Behavior
   • Dependent Controls
   • Nested Database Values
   • Dynamic Dropdowns
   • Runtime Refresh
   • Search and New Badges
   • Custom Hosted Editors
  Polish
   • Support Links
   • Theme Colors
   • Theme Borders

Clone this wiki locally