MegaMech, on 22 December 2012 - 06:59 AM, said:
I can't figure out the table for VertMenu()
I think you should add a bit more instructions to your post.
Otherwise, this is pretty cool, and looks clean... I'm probably gonna use it for a Stats Program I'm making. (Shows the status of all your industry's stuff)
how do I make it so if I choose "all" It shows table2 and if I choose "my" it shows everything from table3
or
if I choose "all" it shows table2[1] and if I choose "my" it shows table2[2]
I think you should add a bit more instructions to your post.
Otherwise, this is pretty cool, and looks clean... I'm probably gonna use it for a Stats Program I'm making. (Shows the status of all your industry's stuff)
table={"all","my","stuff"}
table2={"in","here","done"}
result = VertMenu(table)
result2 = Vertmenu(table2)
This makes it so if you select anything from table it shows everything from table2how do I make it so if I choose "all" It shows table2 and if I choose "my" it shows everything from table3
or
if I choose "all" it shows table2[1] and if I choose "my" it shows table2[2]
You make use of an if statement
result = {}
if result[1] == this then
result[2] = something
elseif result[1] == that then
result[2] = something_else
elseif result[1] == other then
result[2] = another_thing
end
if result[2] == even then
result[3] = something_again
elseif result[2] == more then
result[3] = something_new
elseif result[2] == things then
result[3] = another_thing_entirely
end
--and so on and so forth....
Instead of making the result table equal to those made up variables, you can call the menu function to generate sub menus.
EDIT: In fact I get this question so often I have put some sample code under the VertMenu section (in a spoiler) to show how this might be done.











