I know the function
Function Main()
If menu == 1 then Submenu()
and so on...
But what I want to do is for example
I have a table with all characters incl. their values I need
local characters = {
{sname = "bunny", name = "bunny rabbit", size = 4, size2 = 8, size3 = 9},
{sname = "mouse", name = "Micky Mouse", size = 1, size2 = 12, size3 = 22},
{sname = "cow", name = "the cow", size = 30, size2 = 33, size3 = 423},
{sname = "boy", name = "a friend", size = 44, size2 = 55, size3 = 666}
}
as main menu - "character selection"
-> below it the submenu - "Initial letter A
-> below that the submenu - "Initial letter B"
-> -> below that all characters starting with the letter B should appear and be selectable. So "bunny" and "boy
But I don't want to program every single submenu with function bunny() or function boy().
Is there a way to automatically create the submenus based on the table and make them selectable. The value should then simply be written to a variable provided for this purpose.
The problem is that the table is constantly growing, so I would have to add each time a submenu by hand.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Question
Maddin
Hello,
I would like to make a menu including submenus.
I know the function
Function Main()
If menu == 1 then Submenu()
and so on...
But what I want to do is for example
I have a table with all characters incl. their values I need
local characters = {
{sname = "bunny", name = "bunny rabbit", size = 4, size2 = 8, size3 = 9},
{sname = "mouse", name = "Micky Mouse", size = 1, size2 = 12, size3 = 22},
{sname = "cow", name = "the cow", size = 30, size2 = 33, size3 = 423},
{sname = "boy", name = "a friend", size = 44, size2 = 55, size3 = 666}
}
as main menu - "character selection"
-> below it the submenu - "Initial letter A
-> below that the submenu - "Initial letter B"
-> -> below that all characters starting with the letter B should appear and be selectable. So "bunny" and "boy
But I don't want to program every single submenu with function bunny() or function boy().
Is there a way to automatically create the submenus based on the table and make them selectable. The value should then simply be written to a variable provided for this purpose.
The problem is that the table is constantly growing, so I would have to add each time a submenu by hand.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.