ID:2065333
 
How do you I customize the grid of where my skill list appears so I can fit more skills. Right now there is a single column of skills. I would like several rows or the ability to customize the grid in-game.
There are a couple ways to go. If you don't mind it auto-fitting, then with a grid you could use is-list and just output all of the items as if it were a single column. They'd get arranged into rows automatically, using as many columns as the grid can fit.

The other option is to choose exactly how many columns you want, and write your output so that it puts each skill in the correct row and column.
I am still getting one column. What am I doing wrong? I would prefer auto-fitting skills if possible.
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=[grid_item]")
if(client)src.RefreshSkillList2()
First off, you should have only one if(client) and put all your code under that; you don't need to keep checking it because client will not become null after a winset(). (A winget(), or anything else that requires an interactive response, is different.)

If you're only getting one column from that code, it's because your cells are too wide to fit two columns in the grid. If you want to force multiple columns, then is-list is out of the question and you'll need to output to a specific row and column.
Why am I not getting two columns. If it is because my cells are too wide how would I make them smaller?
var/list/mylist = new/list
for(var/skillcard/A in contents) mylist.Add(A)
winset(src, "skills_pane.skills_grid", "cells=2x[mylist.len]")
for(var/i=1, i<=mylist.len, ++i)
var/skillcard/techniques = mylist[i]
src << output(techniques, "skills_pane.skills_grid:1,[i]")
You're only outputting to one column. If you want the skills in two columns, obviously some of them have to be in column 1, and some in column 2, and you only need mylist.len/2 (rounded up) for the number of rows.
        UpdateBagTehniques()
set hidden = 1
winset(src, "Items", "cells=2x[techniques.len]")
for(var/i=1, i<=techniques.len, ++i)
var/obj/item = techniques[i]
src << output(item, "Items:1,[i]")
src << output((item&&item.suffix), "Items:2,[i]")


Here is the example of how I did it for tech display.

winset(src, "Items", "cells=2x[techniques.len]")


This is what you need cell =2 x techniques.len. So all we are doing is adding column x techniques.len or whatever you will use in your case

Also what you did was good but instead of displaying 2 column you displaied only one like Lummox said.


Does anyone know how I can decrease the size of my cells so that the things I am outputting will be auto fitted automatically into rows?
I don`t quite get what do you want to achive. Be more specific about it :P I allready show you the example and Lummox JR did a great job explaining it to you


All I want to do is be able to output all the grid items to one column and have them automatically get arranged into rows using "is-list" or any other method.
Lummox stated that the reason my previous snippet was only getting one column is because my cells were too wide, and I would not be able to autofit.
How do I decrease the size of my cells or make it so that the items are autofitted into the grid.
I dont know if it will helps you but one method im using to set the size of it is to add this into grid style : IMG.icon{width:64;height:64}.
http://prntscr.com/aplabl