ID:2100633
 
So i'm trying to figure out why my grid doesn't change. I have the grid set to "is-list." It is flexible so I'm not sure why the number of columns and rows always stays the same even if the number of things being outputted increases. I've seen other grids automatically change the number of rows or columns to better fit the contents with the same kind of output and settings I have, so I'm not sure what's going on.
if(client)
var/grid_item = 0
for(var/skillcard/X in contents)
src << output(X, "skills_grid:[++grid_item]")
winset(src, "skills_grid", "cells=\"[grid_item]\"")
Probably because the proper format for outputting cells is "nxn" where n are integers describing the grid's size.
Even with that format I'm getting the same exact result.
In response to Mav472
Mav472 wrote:
Even with that format I'm getting the same exact result.

Let's see it.
In response to FKI
I shouldn't even have to use this format to achieve what I'm trying to do. Even with that format it does not work.
var/grid_item = 0
for(var/skillcard/X in contents)
if(client) src << output(X, "skills_grid:[++grid_item]")
if(client)winset(src, "skills_pane.skills_grid", "is-list=true")
if(client) winset(src, "skills_grid", "cells=2x2")
if(client)src.RefreshSkillList2()
What are you expecting exactly?

I just played around with grids, and while I did find some behavior to be undesirable, that's just how it is. I think you might be mistaking a specific game's setup (i.e. use of grids) with a code problem.
Literally no matter how I change the code the skills grid always remains the same. It should output skills in a fashion so that the list is actually flexible and the number of columns or rows are set automatically. I've seen this on tons of other games and I just want to know how.
if(client)
var/grid_item = 0
for(var/skillcard/X in contents)
src << output(X, "skills_grid:[++grid_item]")
winset(src, "skills_grid", "cells=\"[grid_item]\"")

You shouldn't have the escaped quotes around the cells parameter in that last line.

What are you seeing when you run this code? Can you give me a couple of screenshots?
In response to Lummox JR
https://gyazo.com/9b47fd3f34683e8c7d63d903e9935576

It displays one long list of skills. The escaped quotes don't seem to make a difference because I get the same output even if I don't include them. I used to get more rows or columns automatically based on the number of things that were actually outputted. I'm not sure what I did but when I changed the interface around it always sticks to one long list even if it's suppose to be flexible.

I have both of these checked as well.
https://gyazo.com/f3b9138a5bc06faf56d8332e6a3895d1

As far as settings I haven't really changed anything just the sizes and childs. I've tried making the skills grid smaller in terms of width and/or length. I've tried using a different interface. I always end up with one long row of skills.

I just want to output columns and rows based on number of contents automatically so that I can fit more skills in the grid without having one long list. Even two rows would be better at this point.
If you want to force a certain number of columns, the is-list setting is not for you. That setting tells the grid to fit its items into as many columns as possible. Because some of those skills have such long names, they're taking up more than half the width and therefore you'll never get two columns out of that.