-
Notifications
You must be signed in to change notification settings - Fork 0
Widget
An GUI widget (SUI Group) containing a dropdown loaded with presets, load/save button, and all functionality needed. This group can be loaded into a SUI Window, Dialog, Group or Panel.
Usage: Creates a new Widget into given SUI element
Example: Pm.Widget.attachTo( Window, listKeyID, DataPort, *options* )
Returns object: Success: Boolean, comment: String
Window: SUI Window, Dialog, Panel or Group
listKeyID: The key or id to to use when filling the dropdown created by the widget.
DataPort: An object that references two SUI functions { getData: functionRef, renderData: functionRef }:
-
getData:functionto get preset from SUI -
renderData:functionthat takes a preset as parameter and uses this to populates SUI
options: An object to set custom options including: lockChar, newName, buttonTextSave, buttonTextClear
Usage: Get SUI_Preset
Returns object: An unsaved Preset as presented in SUI.
Usage: Get the text
Returns array: Opening and closing preset locking characters ["-","-"]
Usage: Get name of "New Preset" as present in the drop-down (without locking characters)
Returns string: Name of new preset New Preset
Usage: Get name of preset that was last used, as present in the drop-down (without locking characters)
Returns string: Name of last used preset Last Used
Usage: Reset Presets Dropdown to [New Preset] without changing any SUI data
Returns boolean: Success
Usage: Reset Presets Dropdown to [Last Used] updating any SUI data
Returns boolean: Success
Usage: Load Presets[index] in UiPreset and update UI
Returns boolean: Success
Usage: Save SUI data to UiPreset
Returns boolean: true
Usage: Save SUI data as Preset to Presets
Returns boolean: true
Options: An optional object to set options:
-
updateProps:Arrayof property names to be updated before saving. ([name:'New Name']) -
position:IntegerThe position to which to save thePresetinPresets
Usage: Overwrite UiPreset where Key:val matches in Presets
Returns boolean: true
Note: This function saves Presets to disk.
Options: An optional object to set options:
-
position:IntegerThe position/index to be overwritten inPresets