ID:157047
 
Okay I have this code for the players to navigate the title menu.
mob/menu
var/tmp/selection
proc
command(identity,value,client/C)//called when a player presses enter or an arrow key
world<<"called"
switch(identity)

if("Move")
if(value==NORTH)//if player presses up, move up (subtract 1)
selection-=1
if(value==SOUTH)//if player presses down, move down (add 1)
selection+=1
selection=(selection%3)//make sure the selection is between 0 and 2
if(selection==(-1))
selection=2
moveselection(C)
if("Enter")//if player presses enter do the action
switch(selection)
if(0)
newgame(C)


if(1)
loadproc(C)

if(2)
del C.mob

moveselection(client/C)//Move the arrow which points to the selection the player is currently choosing
world<<"moveselection[selection] client:[C]"
switch(selection)
if(0)
winset(C, null, {"
pane_splash.select1.is-visible = "true";
pane_splash.select2.is-visible = "false";
pane_splash.select3.is-visible = "false";
"}
)

if(1)
winset(C, null, {"
pane_splash.select1.is-visible = "false";
pane_splash.select2.is-visible = "true";
pane_splash.select3.is-visible = "false";
"}
)

if(2)
winset(C, null, {"
pane_splash.select1.is-visible = "false";
pane_splash.select2.is-visible = "false";
pane_splash.select3.is-visible = "true";
"}
)


However I want a do a more two dimensional list instead of this 1 dimensional list. I could probably do this by having the up and down effect one variable while the left and right arrow keys another. My problem, though, comes when I want to do this with a flexible ever changing list, say, a list of items. How could I modify my code to be able to navigate and select an item in a list?
You don't exactly need that, just override the client Movement procs. namely North,South,East,West. that is sufficient.
In response to Soul Sign
Please answer my question. For your information, this is overrunning the client movement procs by using an interface datum much like in Iain Peregrine's interface tutorial:

http://www.byond.com/members/ DreamMakers?command=view_post&post=49308.

Your comment doesn't help me at all, what I wanted to know is how could I apply a similar method that I posted above to be able to move and select things on a changing list, like a list of items in a mobs content. I also want this list to be two dimensional(with columns and rows,not one dimensional (items stacked upon each other).

Thanks in advance, and if there are any other problems with my code (perceived or real) please tell me, I want to be able to program better.
In response to Froggersucks
Froggersucks wrote:
Please answer my question. For your information, this is overrunning the client movement procs by using an interface datum much like in Iain Peregrine's interface tutorial:

I think what I said was fair enough, if you use a lil more of your head.

http://www.byond.com/members/ DreamMakers?command=view_post&post=49308.

Your comment doesn't help me at all, what I wanted to know is how could I apply a similar method that I posted above to be able to move and select things on a changing list, like a list of items in a mobs content. I also want this list to be two dimensional(with columns and rows,not one dimensional (items stacked upon each other).
interface with changin lists would normally make me point out to Girds.using some grafix trick like highlighting,or darkening or arrow_pointin.... yes using winset.

and use the client moves to change the effect.

This is just a matter of personal figuring out, and all we need is some experimenting and testing. (for example, mess around with current-cell in the girds.)

or theres even a whole new method..
create runtime elements and depending on the list create them the way you want,(for example : creating buttons can give you options like border, bg-color etc.. for making it look like its selected.)
but watever girds would be better if you knew how to handle them.