Ok, i am working on creating a menu right, now when ever the usr presses his down button, i want it to make the cursor go down on. Why doesnt mine work?
By the way, it uses Client.screen
mob
proc
menucheck(direction,menu)
if(menu == "playermenu")
if(direction == SOUTH)
for(var/obj/menu/Curser/c in usr.client.screen)
src << "i found [c]!"
src << "[c.screen_loc]"
step(c,SOUTH)
ID:148701
Nov 5 2002, 1:46 am
|
|
Nov 5 2002, 5:53 am (Edited on Nov 5 2002, 7:55 am)
|
|
The problem here is that step() can't be used for screen objects. You're going to have change the value of screen_loc to get it to move the way you want it to. If you give the cursor an xcoord and ycoord, you can use those values to adjust the screen position of the cursor. Also, I'm going to assume you only have one cursor on screen at a time(though, I'm not sure why it would be otherwise), so you can ditch that for() loop and just use locate(). You'll need to reset the value of xcoord and ycoord after someone closes one of the menus as well.
|
In response to tenkuu
|
|
tenkuu wrote:
The problem here is that step() can't be used for screen objects. You're going to have change the value of screen_loc to get it to move the way you want it to. If you give the cursor an xcoord and ycoord, you can use those values to adjust the screen position of the cursor. Also, I'm going to assume you only have one cursor on screen at a time(though, I'm not sure why it would be otherwise), so you can ditch that for() loop and just use locate(). You'll need to reset the value of xcoord and ycoord after someone closes one of the menus as well. mob Sick dog! |