Difference between revisions of "VN fnc showMultipleOptionsModal"
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "]]; |p1n=" to "]] |p1n=") |
Lou Montana (talk | contribs) (Page filling) |
||
Line 1: | Line 1: | ||
− | |||
{{Function | {{Function | ||
Line 8: | Line 7: | ||
|a= | |a= | ||
− | |e= | + | |e= local |
|g1= multipleOptionsModal | |g1= multipleOptionsModal | ||
− | |d= | + | |d= Opens up a modal dialog that allows for single or multiple choices. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | |s= [title, options, onExit, singleChoice] call [[VN_fnc_showMultipleOptionsModal]] | |
− | |||
− | + | |p1n= title | |
− | + | |p1t= string | |
− | + | |p1d= title of the vote | |
− | + | |p1v= | |
− | |||
− | + | |p2n= options | |
− | + | |p2t= {{DataType|array}} of {{DataType|string}} | |
− | + | |p2d= options items are in format [title, action, arguments]: | |
− | + | * title: {{DataType|string}} | |
− | + | * action: {{DataType|code}} | |
− | + | * arguments: {{DataType|array}} | |
− | + | |p2v= | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | |p3n= onExit | |
+ | |p3t= code | ||
+ | |p3d= function called when a player exits the modal, a nested array is passed to the function. Nested array is as follow: [_this: See {{Biki|User_Interface_Event_Handlers#onUnload|OnUnload EH}}, _selected: Array of selected option indexes] | ||
+ | |p3v= | ||
− | | | + | |p4n= singleChoice |
− | + | |p4t= boolean | |
− | + | |p4d= if set to {{Biki|true}}, options act like a radio button (only one option can be selected); {{Biki|false}} allows to select multiple options. | |
− | + | |p4v= {{Biki|true}} | |
− | | | ||
− | | | ||
− | |||
− | | | ||
− | | | ||
− | | | ||
− | | | ||
− | |r1t= | + | |r1t= boolean |
− | |r1d= | + | |r1d= {{Biki|true}} if the dialog was successfully created. Empty title or no options will return {{Biki|false}} |
− | |x1= <code> | + | |x1= <code>[ |
+ | "Do you like pineapple on pizza?", | ||
+ | [ | ||
+ | ["Yes", { systemChat str _this; }, []], | ||
+ | ["No", { systemChat str _this; }, []], | ||
+ | ["No, but I never tried", { systemChat str _this; }, []], | ||
+ | ["Yes, but I never tried", { systemChat str _this; }, []], | ||
+ | ["I am neutral", { systemChat str _this; }, []] | ||
+ | ], | ||
+ | { systemChat str _this; }, | ||
+ | true | ||
+ | ] call [[VN_fnc_showMultipleOptionsModal]];</code> | ||
}} | }} |
Latest revision as of 14:24, 30 January 2021
← back to Functions | Introduced in S.O.G. Prairie Fire v1.00 by Heyoxe |
|
Description
Opens up a modal dialog that allows for single or multiple choices.
Syntax
- Syntax
- [title, options, onExit, singleChoice] call VN_fnc_showMultipleOptionsModal
- Parameters
- title: String - title of the vote
- options: Array of String - options items are in format [title, action, arguments]:
- onExit: Code - function called when a player exits the modal, a nested array is passed to the function. Nested array is as follow: [_this: See OnUnload EH, _selected: Array of selected option indexes]
- singleChoice: Boolean - (Optional, default
true
) if set to true, options act like a radio button (only one option can be selected); false allows to select multiple options. - Return value
- Boolean - true if the dialog was successfully created. Empty title or no options will return false
Examples
- Example 1
[ "Do you like pineapple on pizza?", [ ["Yes", { systemChat str _this; }, []], ["No", { systemChat str _this; }, []], ["No, but I never tried", { systemChat str _this; }, []], ["Yes, but I never tried", { systemChat str _this; }, []], ["I am neutral", { systemChat str _this; }, []] ], { systemChat str _this; }, true ] call VN_fnc_showMultipleOptionsModal;