VN_fnc_showMultipleOptionsModal

From Savage Game Design Wiki
Jump to navigation Jump to search
← back to Functions Introduced in S.O.G. Prairie Fire v1.00
by Heyoxe
Argument(s): n/a
Effect(s): local

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;