ID:1590138
 
(See the best response by Legacy of Caine.)
I know this is some what a noob question but, how would i go about a hair grid like structure, i know i would have to use a grid and a skin, but how do i create the skin thingy, would anyone like to lead me to a example?
You mean like a screen where a player chooses a hair type?
Best response
File > New > Interface.

Then you'd need to make your default interface which usually includes at least a map (you'd need an input and output if you're not using on-screen HUD elements for chat). Then create a seperate window with a grid and fill it with hairs when you call the grid.
Yeah a similar to DU, when you go through the character creation it gives you a new window with a list of all the hairs.
Yeah, make your interface get a default window sorted and then make a second window with a grid inside it.
Then how would i go about with the code?

proc/hairGrid()
var/list/hairs = list(new/obj/Hair/Kirito)
var/i = 0
for(var/obj/Hair/h in hairs)
i++

This is how i'm adding hair to the grid
use the output() proc to send the objects to the grid.

Open Dream Maker and hit F1 and read the guide on output()
Even though I can't get the best vote anymore, here is an example.

#define HAIR_WINDOW "window_name"
#define HAIR_GRID "grid_name"

var/list/hair_list=list()

proc
loadHairs()
hair_list=list()
for(var/a in typesof(/obj/Hair))
if(a==/obj/Hair)continue
hair_list+=new a

world
New()
.=..()
if(.)loadHairs()

mob/Login()
display_hairs(src)


proc
display_hairs(mob/player)
if(!player||!player.client||!hair_list.len)return
for(var/a in hair_list)
player<<output(a,"[HAIR_WINDOW].[HAIR_GRID]")


/obj/Hair
Test1
Test2
Test3


Code is untested but should work.

Just set the "window_title" to your window's title and the "grid_name" to your grids name.
If you're doing it that way and want to replicate Dragonball Universe then you'd also need the Click() process on your hair objects that set the players hair.

And unless I'm missing something, in the above example you'd be missing opening the hair window or setting it's visibility to be true. But the basis for putting the hair objects in a grid would work just fine. You could play with the grid element to better customise it, removing the names of the hair for example.
^ Correct, but I'm sure he understands that, at least I think so. He just wanted to get the hair in a grid haha.

Oops forgot to mention, make the grid flexible for entries!
Nope, I was dead wrong, he gets a white grid. My guess is because of there being multiple mob/Logins and/or multiple world/News() without ..() one another.

:/ Oh well, AFK.
Have you set the current cells in your mock up for it?
I told him to make the grid flexible because I didn't want to explain that to him as well