Ok, here's a slimmed down version of what I'm trying to work with:
//begin code-global
class item
{
string name;//name of the item
int number;//array reference of the item, used for announcements
int status;//status of the item. This is going to be 0, 1, or 2, menus only
activate if status=2
//add extra variables and functions
}
item [] items(x);//array of items
int [] menulist;//array of ints containing the reference value of all items
whose status variables are 2
void buildlist ()
{
//this figures out what items have status at 2
for(counter=1; counter<items.length; counter++)
{
if(items[counter-1].status==2) menulist.insert_list(items[counter-1].number);
}
}
//end code
After this, I will have a menu that will have variables for min and max
position, max being determined by the length of the menulist array. When the
user moves through the menu, it will display only the numbers contained in that
array.
----- Original Message -----
From: Cara Quinn <[email protected]
To: Gamers Discussion list <[email protected]
Date sent: Thu, 27 Feb 2014 17:49:30 -0800
Subject: Re: [Audyssey] programming advice: menus
HI John,
YOu do not need to create a second array. You can keep a reference to your
position in the first array, and then check dynamically which element to show
next, forward or backward depending on which direction the player moves in the
menu.
You can choose to skip options which do not meet the criteria you do not want.
I'm not saying that creating a second array is a bad idea or anything by the way, it actually may be desirable to do this depending on how your code is set up, how large / complex your initial array is, and how much of your sanity you would like to
hold on to. ;)
Just mentioning that both methods are possible.
If you send along some code, it will be easier to give you a better, more
precise response.
Thanks,
Cara :)---
iOS design and development - LookTel.com
---
View my Online Portfolio at:
http://www.onemodelplace.com/CaraQuinn
Follow me on Twitter!
https://twitter.com/ModelCara
---
Gamers mailing list __ [email protected]
If you want to leave the list, send E-mail to [email protected].
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/[email protected].
If you have any questions or concerns regarding the management of the list,
please send E-mail to [email protected].