I've seen a few libraries and demos but I cant quite grasp how to display any list in a grid.
I know like winset(src,"src.whatevers","grid:1,1") but it's not enough to display the whole list on the grid.
I'm not a very good explainer but any help?
ID:273699
Jan 8 2011, 6:48 pm
|
|
Jan 8 2011, 9:18 pm
|
|
If you are just displaying the raw contents of a list in a grid, you'll want to of course loop through all objects/entries in the list in question. You will want to assign each object its own Y location in the grid while giving it an X location of 1. This will display the objects in a descending order. For example:
|
In response to Duelmaster409
|
|
Is that better than setting the grid's dimensions ahead of time?
verb/update_inventory() |
In response to Spunky_Girl
|
|
I don't think it honestly matters, but your method would make more sense when briefly skimmed as apposed to mine.
|
In response to Spunky_Girl
|
|
I've always set the grid's size after doing everything. It makes no difference since the final value of i is the same as src.contents.len by the end of the loop.
If you check "is-list" in the grid's properties, you can use this instead, and not have things go only horizontally: mob/proc/update_inventory() I also just put ++i inside the expression because it saves a line while doing the same thing. |