ID:156147
 
I need to know how to pick up things inside of something else, basically.
I need to know how to do a few things to properly work this, because I am having a bit of trouble.

First of all.. How do you make it so when you click the "Check" verb, it displays in a verb panel, all of the contents.

For example
Check()
statpanel("Storage Area")
stat(storagestat)

How do I get this to properly work?
Secondly, how to I make it so the objects can actually be picked up. For the example I have made a paper object..
    Paper
name="Paper"
icon='Icons.dmi'
icon_state="Paper"
verb
PickUp()
set name="Pick up"
set src in oview(1)
src.loc=null
usr.contents.Add(src)
global.storage1-=src
Drop()
src.loc=usr.loc
usr.contents-=src

Now, this doesn't work because I'm looking inside another panel, so it's not in my view.. How can I get it to work inside the panel, and also have it so if you drop it, you need to be next to it to pick it up?

Thanks in advance for the help, much appreciated!
I'd do something like this:

mob
var
list/statpanels = list()
Stat()
for(var/atom/O in statpanels)
if(get_dist(src,O)<=1)
statpanel(O.name,O.contents)
else
statpanels.Remove(O)

obj
can
verb
Check()
set src in oview(1)
mob.statpanels += src


You can figure out some method of getting the pickup/drop verbs to work within the can on your own from here?
In response to Ter13
Seems to all work, after some messing around and adjusting.. But the pickup/drop is a problem.. not sure what to do.
In response to Xyphon101
If you want the verb to only be available under a certain condition, then there are only 2 approaches to do so:
1) Use an 'src setting' that satisfies your desired condition.
2) Dynamically add and remove the verb from the respective atom's <small>(well, or possibly cilent's)</small> verbs list.

(Of course, if the situation somehow called for it, you could also mix the two)

If you were going to use option #1, then you'd have to use some kind of dummy src setting, as there isn't one that suits your situation AFAIK. For example, you could pick some arbitrary setting such as set src in usr.contents, set src in usr.client.screen or set src in usr.group and then set it up so the setting condition is only satisfied when you want the verb to be available (in this case, when the player is viewing the specific statpanel).

In this case, if you want the verb to be usable from the item's right-click menu and be entirely unavailable when it can't be used (i.e., when no item is being viewed), then I think you must use method #1.