ID:141981
 
I'm not exactly sure how to get grids to work the way I want them.

I want a grid to create a skill list that includes the following things:
[Icon]Skill Name: Skill Level
I've tried the following things but none of them really work, so I'm asking for someone to assist me on getting a grid to work properly in the way I want.

Trial One:
        proc
UpdateSkills()
winset(src,"skills","current-cell=1,1")
src << output({"<font color = lime>
\icon
[image('skillicons.dmi',"blade")]Blade: [src.blade]<br>
</font>"}
,"skills")

What Happens: Basically I get the icon Blade: 1. Problem is is that the icon is extremely tiny (Something like 8x8 or 12x12) and the text merges into the icon.

Trial Two:
        proc
UpdateSkills()
winset(src,"skills","current-cell=1,1")
src << output({"<font color = lime>
\icon
[icon('skillicons.dmi',"blade")]Blade: [src.blade]<br>
</font>"}
,"skills")

What happens: In this one I get the same result as Trial One, for pretty obvious reasons in my opinion.

Trial Three:
        proc
UpdateSkills()
winset(src,"skills","current-cell=1,1")
var/obj/tempicon = new/obj/tempicon('skillicons.dmi',"blade","Blade:")
src << output({"<font color = lime>
\icon
[tempicon]Blade: [src.blade]<br>
</font>"}
,"skills")


Note: /obj/tempicon is just a creation of an obj that has the first two things set its icon, and the third set its name.
What happens: In trial Three I get nothing in the form of an icon. If I remove the '\icon' I get Blade:Blade:. I thought that having the obj there added the obj's icon and then its name. That's how it works in statpanels at least, but these arent statpanels =P
Polantaris wrote:
I'm not exactly sure how to get grids to work the way I want them.

I want a grid to create a skill list that includes the following things:
[Icon]Skill Name: Skill Level
I've tried the following things but none of them really work, so I'm asking for someone to assist me on getting a grid to work properly in the way I want.

Trial One:
>       proc
> UpdateSkills()
> winset(src,"skills","current-cell=1,1")
> src << output({"<font color = lime>
> \icon
[image('skillicons.dmi',"blade")]Blade: [src.blade]<br>
> </font>"}
,"skills")
>

What Happens: Basically I get the icon Blade: 1. Problem is is that the icon is extremely tiny (Something like 8x8 or 12x12) and the text merges into the icon.

Trial Two:
>       proc
> UpdateSkills()
> winset(src,"skills","current-cell=1,1")
> src << output({"<font color = lime>
> \icon
[icon('skillicons.dmi',"blade")]Blade: [src.blade]<br>
> </font>"}
,"skills")
>

What happens: In this one I get the same result as Trial One, for pretty obvious reasons in my opinion.

Trial Three:
>       proc
> UpdateSkills()
> winset(src,"skills","current-cell=1,1")
> var/obj/tempicon = new/obj/tempicon('skillicons.dmi',"blade","Blade:")
> src << output({"<font color = lime>
> \icon
[tempicon]Blade: [src.blade]<br>
> </font>"}
,"skills")
>

Note: /obj/tempicon is just a creation of an obj that has the first two things set its icon, and the third set its name.
What happens: In trial Three I get nothing in the form of an icon. If I remove the '\icon' I get Blade:Blade:. I thought that having the obj there added the obj's icon and then its name. That's how it works in statpanels at least, but these arent statpanels =P

Use your trial one and go in your grid, click on style and place this code,

IMG.icon { width:48px; height:48px; }


that will enlarge the icons in the grid!
In response to Neji Hyuuga Prince
Neji Hyuuga Prince wrote:
Use your trial one and go in your grid, click on style and place this code,

> IMG.icon { width:48px; height:48px; }
>

that will enlarge the icons in the grid!

That gets the icon to the right side (Thanks), but the problem where the text is printed over the icon is still there. It also only allows me to add 1 icon at a time per cell, but I wanted it to work like each cell is a type of skill tree (Weapon, Armor, Magic, etc)
In response to Neji Hyuuga Prince
I decided to just add spaces after the icon (about 8 is what I needed) and it fixed the problem I had with the overlaying.
I just have a question now that might be really simple:

Is it possible to make it so that the grid only branches downward? Right now if I maximize my window (Which is 800x600 to 1920x1280, not sure if its much of a problem on other resolutions, but I still dont like it), it makes the grid branch to a 2xwhatever so everything is uneven. I set everything up so that:
Weapon Skills:
Skill 1
Skill 2
Skill 3
Skill 4
Armor Skills
etc...
And when I maximize it ends up like this:

Weapon Skills: Skill 1
Skill 2 Skill 3
Skill 4 Armor Skills
Etc.

And quite honestly, dunno how anyone else feels about that, but its ugly and screws up the flow of the grid.

Is there a way to fix this? (I made the grid as small as possible without messing it up basic size, it used to be 4xwhatever instead of 2xwhatever)