ID:148697
 
Ok, ive made my menu, and for some reason now, whenever i push down, once, twice, how ever many times, then press North, it goes south instead. Then i press north agian and it goes north. Its the same with pressing South, the pressing north, it goes south then north. I dont know why either. Can anyone help, or is this a bug?


client
Northeast(){return}
Northwest(){return}
Southwest(){return}
Southeast(){return}
North()
if(usr.inmenu==1)
if(usr.nomenu==0)
for(var/obj/menu/Curser/c in usr.client.screen)
if(usr.location_in_menu == 0)
return
else
usr.location_in_menu--
usr.currentdir = NORTH
c.screen_loc = "[c.xcoord],[c.ycoord++]"
usr << "[usr.location_in_menu]"
return

else ..()

South()
if (usr.inmenu==1)
if(usr.nomenu==0)
for(var/obj/menu/Curser/c in usr.client.screen)
if(usr.location_in_menu == usr.bottom_max_limit)
return
else
usr.location_in_menu++
usr.currentdir = SOUTH
c.screen_loc = "[c.xcoord],[c.ycoord--]"
usr << "[c.xcoord],[c.ycoord]"
usr << "[usr.location_in_menu]"
return
The main thing here is that you're using usr in a client proc which is totally wrong. You need to be using src.mob or just mob instead.
In response to tenkuu (#1)
tenkuu wrote:
The main thing here is that you're using usr in a client proc which is totally wrong. You need to be using src.mob or just mob instead.

Actually usr is valid in those, because client.North() and client.South() are really verbs. mob will also be valid however, because it will be the same thing.

Lummox JR
In response to Lummox JR (#2)
If no one can answer this than it might be a bug?
In response to Mrhat99au (#3)
I fixed it, though its quite weird how i fixed it. Neway, im thinking about trying to release a menu libary to byondscape and see if they will accept it. It can display menus, and you can change how many menu items you have etc.