ID:157686
 
I want to know how I would make it so like say when I wear an piece of clothing, the clothing gets added to a list, and you can take all of your clothes off, and then wear them all again in the same order as before.

Example:

Wear Pants
Wear Shirt
Wear Shoes

Take off all clothes

Click Wear All

Clothes go back on in that order.
When the player puts something on, add it to a list. When they take something off, remove it from the list.

When they choose "get undressed", loop through the list and -= everything.

When they choose "get dressed", loop through the list and += everything.

I found some demo code by hitting f1 in dreammaker, clicking topic, and searching for overlays. I made some slight modifications. This example does not account for where, when, and how a player gets their stuff.
obj
icon = 'icon.dmi';
overlay
boots
icon_state = "boots"
layer = ARMOR_LAYER
armor
icon_state = "armor"
layer = ARMOR_LAYER
mob
var
boots = new /obj/overlay/boots
armor = new /obj/overlay/armor
list/allClothing = list()
verb
Put_On_Boots()
allClothing.Add(boots)
overlays += boots
Put_On_Armor()
allClothing.Add(armor)
overlays += armor
Take_Off_Boots()
allClothing.Remove(boots)
overlays -= boots
Take_Off_Armor()
allClothing.Remove(armor)
overlays -= armor
Take_Off_All()
for (var/obj/overlay/o in allClothing)
overlays -= o;
Put_On_All()
for (var/obj/o in allClothing)
overlays += o;

[edit]
Fixed a couple indent problems
In response to PopLava
Always simple stuff that gets me stuck lol. Cheers, I understand now.