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?