ID:158628
 
Is it possible to display a statpanel like list on a grid? I've been working on my projects interface for a long time now, and I'm planning on removing statpanels and making grid inventory tab, skills tab, quests tab, and more.

I tried a code but the output came out to "/list" when picking up an item. I know that this is possible using multiple grids, but I'm trying to keep the game efficient and I currently have object huds on my game but they aren't too efficient.

This is what I have so far:
1: A button that opens up the grid with winshow, and closes any other grid below it.
2: Set up so that when an object is added to the list, I get the outcome: "/list".

If this isn't possible, any ideas on a better method then having to use objects for HUDs?
Outputting a list object to anything other than a statpanel usually ends up in "/list". What you need to do is loop through the items in the list and output each one individually.
mob
var/list/stuff=list("I think this is a:","Good idea")
verb/outputlist()
var/gridtext
for(var/v in src.stuff)
gridtext+="[v]\n"
src<<output(gridtext, "controlshere")


Make sure to set in the skin editor (for the grid) "Is a flexible list of entries".
In response to Kaiochao
Kaiochao wrote:
Outputting a list object to anything other than a statpanel usually ends up in "/list". What you need to do is loop through the items in the list and output each one individually.

Ah. I see.. Thanks for the quick reply. It helped a lot :).
In response to Vic Rattlehead
Vic Rattlehead wrote:
> mob
> var/list/stuff=list("I think this is a:","Good idea")
> verb/outputlist()
> var/gridtext
> for(var/v in src.stuff)
> gridtext+="[v]\n"
> src<<output(gridtext, "controlshere")
>

Make sure to set in the skin editor (for the grid) "Is a flexible list of entries".

Thanks for the code but it's not actually showing the objects on the grid, it only outputs the item's name. I tried modifying it a bit by changing

gridtext+="[v]\n"
//to
gridtext+="[v]"
//but I still only got the item's name to show up so I tried
gridtext+=v
//and it displayed the item perfectly, allowing the click procs to actually work on it, and the object actually showing up on the grid but then I came up with another problem..
//When picking up a second item, I would get a
//runtime error saying type mismatch
//"itemname+=itemname". I know what it means
//but I don't know any other way to get the objects to show up on the grid.


I've been trying to get this to work for a long time and I know that I'm close.

Any help is greatly appreciated.
In response to Forerunnerz
This is how I do it my game:
    proc
gridit()
.=0
for(var/O in contents)
src << output(O, "grid1:1,[++.]")