Go to Page... |
Compatibility: | Scribes of Fate (8.3.5) Firesong (8.2.5) Lost Depths (8.1.5) High Isle (8.0.0) |
Updated: | 03/20/23 04:03 PM |
Created: | 04/18/22 06:37 PM |
Monthly downloads: | 6,608 |
Total downloads: | 54,342 |
Favorites: | 38 |
MD5: |
## DependsOn: LibAddonMenuSoundSlider
--[[soundSliderData = { type = "soundslider", name = "My sound slider", -- or string id or function returning a string getFunc = function() return db.var end, setFunc = function(value) db.var = value doStuff() end, autoSelect = false, -- boolean, automatically select everything in the text input field when it gains focus (optional) inputLocation = "below", -- or "right", determines where the input field is shown. This should not be used within the addon menu and is for custom sliders (optional) saveSoundIndex = false, -- or function returning a boolean (optional) If set to false (default) the internal soundName will be saved. If set to true the selected sound's index will be saved to the SavedVariables (the index might change if sounds get inserted later!). showSoundName = true, -- or function returning a boolean (optional) If set to true (default) the selected sound name will be shown at the label of the slider, and at the tooltip too playSound = true, -- or function returning a boolean (optional) If set to true (default) the selected sound name will be played via function PlaySound. Will be ignored if table playSoundData is provided! playSoundData = {number playCount, number delayInMS, number increaseVolume}, -- table or function returning a table. If this table is provided the chosen sound will be played playCount (default is 1) times after each other, with a delayInMS (default is 0) in milliseconds in between, and each played sound will be played increaseVolume times (directly at the same time) to increase the volume (default is 1, max is 10) (optional) showPlaySoundButton = false, --Boolean or function returning a boolean. If true a button control will be shown next to the slider, which will preview the selected sound (based on playSoundData or playSound. If both are nil/false the button won't be shown) (optional) noAutomaticSoundPreview = false, --Boolean or function returning a boolean. Only works if showPlaySoundButton is true! If true the automatic sound preview (based on playSoundData or playSound) will be disabled and only the sound preview button is shown (optional) readOnly = true, -- boolean, you can use the slider, but you can't insert a value manually (optional) tooltip = "Sound slider's tooltip text.", -- or string id or function returning a string (optional) width = "full", -- or "half" (optional) disabled = function() return db.someBooleanSetting end, --or boolean (optional) warning = "May cause permanent awesomeness.", -- or string id or function returning a string (optional) requiresReload = false, -- boolean, if set to true, the warning text will contain a notice that changes are only applied after an UI reload and any change to the value will make the "Apply Settings" button appear on the panel which will reload the UI when pressed (optional) default = defaults.var, -- default value or function that returns the default value (optional) helpUrl = "https://www.esoui.com/portal.php?id=218&a=faq", -- a string URL or a function that returns the string URL (optional) reference = "MyAddonSoundSlider" -- unique global reference to control (optional) } ]]
--Global function to convert the soundSlider soundIndex to the internal SOUNDS name (SOUNDS = { [soundName] = sound_internal_name, ... } --Parameters: soundIndex number --Returns nilable:internal_sound_name String function ConvertLAMSoundSliderSoundIndexToName(soundIndex) --Global function to convert the soundSlider soundNameInternal of SOUNDS to the index used in this widget (SOUNDS = { [soundName] = sound_internal_name, ... } --Parameters: soundNameInternal string --Returns nilable:widgetsSoundIndex number function ConvertLAMSoundSliderSoundNameToIndex(soundNameInternal) --Global function to play the sound of an internal_sound_name, or by using the soundIndex of the soundSlider widget. --The sound will be optionally played "volume" times (1 to 10) to increase the volume. --The sound will be optionally repeated "repeats" time, with a "repeatDelayMS" delay in milliseconds in between. --Volume default is 1, repeats default is 1 and repeatsDelayMS default is 0 milliseconds --Either the soundNameInternal or the soundIndex must be given! --Parameters: soundNameInternal optional:string, soundIndex optional:number, volume optional:number(1 to 10), repeats optional:number, repeatDelayMS optional:number milliseconds --Returns nilable:boolean wasPlayed function PlayLAMSoundSliderSound(soundNameInternal, soundIndex, volume, repeats, repeatDelayMS)
local internalSoundName = ConvertLAMSoundSliderSoundIndexToName(myAddonName.savedVariablesTable.selectedSoundIndexOfSoundSlider) if internalSoundName ~= nil then PlaySound(internalSoundName) end
{ type = 'soundslider', name = "My sound slider 1", tooltip = "This is a sound slider, number 1", playSound = false, --play the sound upon selection (disabled automtically internally as playSoundData table was provided too!) playSoundData = {playCount = 2, delayInMS = 500, increaseVolume = 2 }, -- play 2 times with a delay in between of 500ms, making the volume increase by 2 (same sound is played 2 times at the same time) showPlaySoundButton = function() return true end, noAutomaticSoundPreview = true, --do not play the sound upon selection/change (use the sound preview button to manually play it) showSoundName = true, --show the sound name at the slider's label and tooltip saveSoundIndex = false, -- save the sound name, not the index (index could change) getFunc = function() return myAddon.settings.soundName1 end, setFunc = function(value) myAddon.settings.soundName1 = value end, default = myAddon.settingsDefault.soundName1, reference = "MyAddonSoundSlider1", },
--Global function to convert the soundSlider soundIndex to the internal SOUNDS name, which you can play via the --API function PlaySound(internal_sound_name) --Parameters: soundIndex number of the soundSlider's getFunc. -->Will only work if the soundSlider's soundSliderData table entry saveSoundIndex == true! Else the getFunc's returned -->value will be the internal_sound_name String already! --Returns internal_sound_name String function ConvertLAMSoundSliderSoundIndexToName(soundIndex)
File Name |
Version |
Size |
Uploader |
Date |
4 |
11kB |
Baertram |
03/03/23 03:25 PM |
|
3 |
11kB |
Baertram |
03/02/23 12:35 PM |
|
2 |
9kB |
Baertram |
04/19/22 04:13 AM |
|
1 |
8kB |
Baertram |
04/18/22 06:37 PM |
There have been no comments posted to this file.
Be the first to add one. |
You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.