Custom Dropdowns for inputting values into a script

Rinn

Developer
If you need to pass in certian datatypes to a script, like location for example, mafia will create a dropdown with all the locations for you to select. What I'd like to be able to do is have some way to create a dropdown like that manually where I can pass in an array (well a map) of elements to be selected, similar to how I can call user_confirm().
 

jasonharper

Developer
Strangely, there doesn't seem to be any way to prompt the user for anything more than a boolean. I suppose your script could play 20 Questions using user_confirm to input arbitrary data...

I misread your question at first, and thought you were asking for a way to pop up one of the existing value selecting dialogs at an arbitrary time. I did come up with a way to do that; it's ugly, but you'd at least be able to prompt for a string or integer (perhaps to select from a list previously printed to the gCLI window). The idea is to create helper scripts, one for each type of data you need to input, with a main() function that takes one parameter of that type. All they would do is store that parameter in a property, "temp" perhaps. In your main script, you'd do a cli_execute() of the helper script, passing no parameters (so that the automatic prompting kicks in), and then examine the property.
 

Rinn

Developer
No, I do want a way to pop up one of the existing value selection dialogs at an arbitary time, and I also want the ability to be able to define what options appear in a value selection dialog as well. As far as that is concerned, there doesn't seem to be any possible ways to do this though script it would have to be built into mafia.
 

zarqon

Well-known member
Can you give an example of a time when you would need to have the user input parameters mid-script? If you come up with a good one, perhaps a prompt(message, type) function is in ASH's future.
 

Rinn

Developer
I wrote a script that checks if you're missing pieces of any outfit. I'd like to be able to to pop up a dialog with a list of every outfit you own that isn't in your inventory so you could pull it from storage, or to be able to buy any missing outfit without needing to run the script again and pass in a string parameter.
 
Top