//Creating the list
////////////////////
mob/var/tmp/list/Hairoptions2 = list(new /obj/HairSelection2/haircolor1, new /obj/HairSelection2/haircolor2, new /obj/HairSelection2/haircolor3,
new /obj/HairSelection2/haircolor4, new /obj/HairSelection2/haircolor5, new /obj/HairSelection2/haircolor6, new /obj/HairSelection2/haircolor7,
new /obj/HairSelection2/haircolor8, new /obj/HairSelection2/haircolor9, new /obj/HairSelection2/haircolor10, new /obj/HairSelection2/haircolor11,
new /obj/HairSelection2/haircolor12, new /obj/HairSelection2/haircolor13, new /obj/HairSelection2/haircolor14, new /obj/HairSelection2/haircolor15,
new /obj/HairSelection2/haircolor16, new /obj/HairSelection2/haircolor17, new /obj/HairSelection2/haircolor18, new /obj/HairSelection2/haircolor19,
new /obj/HairSelection2/haircolor20, new /obj/HairSelection2/haircolor21)
//The proc thats called by user once new character is clicked
/////////////
mob/proc/BuildHairColourGrid()
var/Hairs2 = 0
for(var/obj/HairSelection2/O in Hairoptions2)
src << output(O, "haircolour:[++Hairs2]")
Problem description: Now as usual with most my code snippets this works fine more or less.. it does what it needs to do which is a good sign.
Now hopefully with that snippet you are able to determine that the hair choices are indeed objects that have a click command that follows through once they are actually outputted.
My question is this: Is there anyway i could make this more proficient (such as not needing to actually define each and every object in that list)
If you require any more information please drop what you wish to know below and i will supply the information if needed.
-Furthermore im not even sure i need that tmp thing in the list but i put it there just incase (since i dont have a save system as per yet)-
Thanks in Advance
Midget.