ID:141618
 
Code:
mob/proc/UpdateBuildVerbs()
var/items = 0
var/list/Test = typesof(/obj/BuildArea)
world << "1"
for(var/obj/O in Test)
world << "2"
winset(src, "buildwindowgrid", "current-cell=[++items]")
src << output(O, "buildwindowgrid")
winset(src, "buildwindowgrid", "cells=[items]")


Problem description:
It seems that it does not want to go past number 1.
So there has to be a problem in the list But I'm out of Ideas right now.
"Test" is a list of types, not objects. Try this:
var/list/Test=list()
var/list/Types=typesof(/obj/BuildArea)
for(var/Type in Test)Test+=new Type

For some reason, newlist() doesn't take lists.
In response to Kaiochao
Thanks, It shows it now, 1 small question though,
If I click on them they won't do the thing they are supposed to do
Is there a way to make them do it?
mob/proc/UpdateBuildVerbs()
var/items = 0
var/list/Test=list()
var/list/Types=typesof(/obj/BuildArea)
for(var/Type in Types)Test+=new Type
for(var/obj/O in Test)
winset(src, "buildwindowgrid", "current-cell=[++items]")
src << output(O, "buildwindowgrid")
winset(src, "buildwindowgrid", "cells=[items]")


obj/BuildArea
TorchRight
Click()
var/obj/building/torch/a=new(usr.loc)
a.owner=usr.key
In response to Vegetassj9
The garbage disposal is deleting them after the proc is over. The object you're clicking doesn't exist, but is still shown in the grid.
Keep them in a separate list. A single global list would work fine, as having one list per player would raise the object and list count, which are unfortunately limited.

If only newlist() could take lists as an argument, then you wouldn't have to go to world/New() to create the list, since newlist() is allowed at compile-time.
In response to Kaiochao
Thanks a lot, It works perfect :)
In response to Kaiochao
I'm taking a guess that's probably because newlist() is just a shortcut instruction (similarly to a #define); the Reference entry for it also suggests it may simply expand to a regular use of list() with new(), and it's just a shorthand version that is compiled into the same result.
EDIT: Also, I know you're aware of the option, but I think it'd be cleaner to compact the code a bit by using typesof() directly instead of storing it to a variable, since that shouldn't be needed.