General > Developers Corner

integer and string input

(1/1)

bender180:
is it possible to have a user be able to input an integer only when a certain string is selected? so say the string is slay is it possible to have a integer input feild enabled for the user to add a value but when any other string is selected the input field is disabled?

JamminR:
In ULX?
http://ulyssesmod.net/docs/files/lua/ulib/shared/commands-lua.html#cmds.NumArg

As for determining it's optionality based on the previous input string, well, uh, I don't think so.
Megiddo and perhaps MrP/Stickly can weigh in on that.

Megiddo:
Yes, command arguments are static. Creating an API for dynamic arguments as you're suggesting would be a nightmare... *shudder*

You can enforce the dynamic aspect yourself by always taking it as a string argument.

Navigation

[0] Message Index

Go to full version