ID:179325
 
Is there anyway to hide objects in client.screen? I tried setting their invisibility to 100 but I could still see them.

The only way I know of to deal with this problem is to delete the objects when you aren't supposed to see them, then create new ones when your supposed to see them. Unfortunately, due to switching the client between mobs, and running other procs in the Click of the menu obj, this becomes much more difficult to manage.

I even tried changing the layer of the obj to TURF_LAYER - 1 (I think that's 0...) but you can see it when your at the bottum or edge of the map.

Any tricks I've missed or suggestions will be appreciated.
If you want to get rid of alot of objects and keep a few, you could set client.screen to null, and add the few objects.

Vise Versa:

You could delete the individual objects using a for() loop to check for them
for(var/obj/blah/B in src.client.screen)
del(B)
In response to Nadrew
I got that part, I need to be able to hide them some other way though. I've got three main menu buttons with 2-3 buttons connected to each of those so it seems kind of wasteful to delete and create new ones each time.
In response to English
If you have the newest beta set the objects invisibility to one.
English wrote:
Is there anyway to hide objects in client.screen? I tried setting their invisibility to 100 but I could still see them.

The only way I know of to deal with this problem is to delete the objects when you aren't supposed to see them, then create new ones when your supposed to see them. Unfortunately, due to switching the client between mobs, and running other procs in the Click of the menu obj, this becomes much more difficult to manage.

There's a simpler way: client.screen -= theobj
obj/screenbutton
New(sl,client/C=null)
screen_loc=sl
if(C) C.screen+=src

proc/ShowTo(client/C)
C.screen+=src

proc/HideFrom(client/C)
C.screen-=src

Lummox JR
In response to Nadrew
you could set client.screen to null, and add the few objects.

client.screen is a list, so its bad form to set it to null (which is not a list). Its better to set client.screen = list() to empty it, rather than to null. Null might work, but thats only because client.screen is a special list and DM autofixes the error. In general, it's bad practice.

-AbyssDragon
In response to Nadrew
I tried that but I can still see it. I think part of the usefullness of client.screen is that you can always see objects in it, that may be what's blocking me.

[Edit]
For some reason when I click on certain menu objects it seems to disallow me from fully using other menu objects. I'll click on the Offer button for instance, then the say button will no longer do anything. Until I have some idea of what is going wrong I'm just going to switch back to using statpanels.

[Edit #2]

Ok, after tinkering and not giving up I discovered the error. I'm not sure why this effected it the way it did, but the problem seems to be fixed now. Basically, I had a list of possible targets but I didn't check to see if any valid targets were found before using:
input_choice = input("Challenge Who?","Offer") in targets

This somehow "jammed" the input so I could no longer receive any input from other procs. Boy, this one sure had me stumped for quite a while.