From 31963b32a431501ed7236a5e0da69028987827c9 Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Wed, 29 Jul 2020 17:14:07 +0100 Subject: [PATCH] subcategories cool --- code/__DEFINES/loadout.dm | 8 +- code/_globalvars/lists/loadout_categories.dm | 2 +- code/controllers/subsystem/job.dm | 8 +- code/modules/client/preferences.dm | 14 ++- .../code/modules/client/loadout/_service.dm | 1 + .../code/modules/client/loadout/backpack.dm | 1 + .../code/modules/client/loadout/glasses.dm | 1 + .../code/modules/client/loadout/gloves.dm | 1 + .../code/modules/client/loadout/hands.dm | 1 + .../code/modules/client/loadout/head.dm | 1 + .../code/modules/client/loadout/mask.dm | 1 + .../code/modules/client/loadout/neck.dm | 1 + .../code/modules/client/loadout/shoes.dm | 1 + .../code/modules/client/loadout/suit.dm | 1 + .../code/modules/client/loadout/uniform.dm | 107 ++++++++++-------- 15 files changed, 88 insertions(+), 61 deletions(-) diff --git a/code/__DEFINES/loadout.dm b/code/__DEFINES/loadout.dm index 7bdfce3738..d4541fd8a7 100644 --- a/code/__DEFINES/loadout.dm +++ b/code/__DEFINES/loadout.dm @@ -17,9 +17,15 @@ #define CATEGORY_HANDS "Hands" //uniform -#define CATEGORY_UNIFORM "Uniform" +#define CATEGORY_UNIFORM "Uniform" //there's so many types of uniform it's best to have lots of categories #define SUBCATEGORY_UNIFORM_GENERAL "General" #define SUBCATEGORY_UNIFORM_JOBS "Jobs" +#define SUBCATEGORY_UNIFORM_SUITS "Suits" +#define SUBCATEGORY_UNIFORM_SKIRTS "Skirts" +#define SUBCATEGORY_UNIFORM_DRESSES "Dresses" +#define SUBCATEGORY_UNIFORM_SWEATERS "Sweaters" +#define SUBCATEGORY_UNIFORM_PANTS "Pants" +#define SUBCATEGORY_UNIFORM_SHORTS "Shorts" //suit #define CATEGORY_SUIT "Suit" diff --git a/code/_globalvars/lists/loadout_categories.dm b/code/_globalvars/lists/loadout_categories.dm index e9f9e2c976..9ebc6cca01 100644 --- a/code/_globalvars/lists/loadout_categories.dm +++ b/code/_globalvars/lists/loadout_categories.dm @@ -3,7 +3,7 @@ GLOBAL_LIST_INIT(loadout_categories, list( CATEGORY_NECK = list(SUBCATEGORY_NECK_GENERAL, SUBCATEGORY_NECK_TIE, SUBCATEGORY_NECK_SCARVES), CATEGORY_MASK = list("NOSUBCATEGORY"), CATEGORY_HANDS = list("NOSUBCATEGORY"), - CATEGORY_UNIFORM = list(SUBCATEGORY_UNIFORM_GENERAL, SUBCATEGORY_UNIFORM_JOBS), + CATEGORY_UNIFORM = list(SUBCATEGORY_UNIFORM_GENERAL, SUBCATEGORY_UNIFORM_JOBS, SUBCATEGORY_UNIFORM_SUITS, SUBCATEGORY_UNIFORM_SKIRTS, SUBCATEGORY_UNIFORM_DRESSES, SUBCATEGORY_UNIFORM_SWEATERS, SUBCATEGORY_UNIFORM_PANTS, SUBCATEGORY_UNIFORM_SHORTS), CATEGORY_SUIT = list(SUBCATEGORY_SUIT_GENERAL, SUBCATEGORY_SUIT_COATS, SUBCATEGORY_SUIT_JACKETS, SUBCATEGORY_SUIT_JOBS), CATEGORY_HEAD = list(SUBCATEGORY_HEAD_GENERAL, SUBCATEGORY_HEAD_JOBS), CATEGORY_SHOES = list("NOSUBCATEGORY"), diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index bbe510490b..4f59992ace 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -674,7 +674,7 @@ SUBSYSTEM_DEF(job) return for(var/i in the_mob.client.prefs.chosen_gear) var/datum/gear/G = i - G = GLOB.loadout_items[G.category][initial(G.name)] + G = GLOB.loadout_items[initial(G.category)][initial(G.subcategory)][initial(G.name)] if(!G) continue var/permitted = TRUE @@ -682,14 +682,14 @@ SUBSYSTEM_DEF(job) permitted = FALSE if(G.donoritem && !G.donator_ckey_check(the_mob.client.ckey)) permitted = FALSE - if(!equipbackpackstuff && G.category == SLOT_IN_BACKPACK)//snowflake check since plopping stuff in the backpack doesnt work for pre-job equip loadout stuffs + if(!equipbackpackstuff && G.slot == SLOT_IN_BACKPACK)//snowflake check since plopping stuff in the backpack doesnt work for pre-job equip loadout stuffs permitted = FALSE - if(equipbackpackstuff && G.category != SLOT_IN_BACKPACK)//ditto + if(equipbackpackstuff && G.slot != SLOT_IN_BACKPACK)//ditto permitted = FALSE if(!permitted) continue var/obj/item/I = new G.path - if(!M.equip_to_slot_if_possible(I, G.category, disable_warning = TRUE, bypass_equip_delay_self = TRUE)) // If the job's dresscode compliant, try to put it in its slot, first + if(!M.equip_to_slot_if_possible(I, G.slot, disable_warning = TRUE, bypass_equip_delay_self = TRUE)) // If the job's dresscode compliant, try to put it in its slot, first if(iscarbon(M)) var/mob/living/carbon/C = M var/obj/item/storage/backpack/B = C.back diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 00ff8715d4..3d63596c3b 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1067,7 +1067,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/category_index = 1 for(var/i in GLOB.loadout_categories) if(category_index != 1) - dat += "
" + dat += " |" if(category_index == category) dat += " [i] " else @@ -1077,6 +1077,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "
" dat += "
[gear_tab]
" dat += "
" + dat += "
" var/subcategory_index = 1 for(var/i in GLOB.loadout_categories[category_section]) if(i == "NOSUBCATEGORY") @@ -1088,6 +1089,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) else dat += " [i] " subcategory_index += 1 + dat += "
" dat += "Name" dat += "Cost" @@ -2885,17 +2887,17 @@ GLOBAL_LIST_EMPTY(preferences_datums) LAZYINITLIST(L) for(var/i in chosen_gear) var/datum/gear/G = i - var/occupied_slots = L[slot_to_string(initial(G.category))] ? L[slot_to_string(initial(G.category))] + 1 : 1 - LAZYSET(L, slot_to_string(initial(G.category)), occupied_slots) + var/occupied_slots = L[initial(G.category)] ? L[initial(G.category)] + 1 : 1 + LAZYSET(L, initial(G.category), occupied_slots) switch(slot) if(SLOT_IN_BACKPACK) - if(L[slot_to_string(SLOT_IN_BACKPACK)] < BACKPACK_SLOT_AMT) + if(L[CATEGORY_BACKPACK] < BACKPACK_SLOT_AMT) return TRUE if(SLOT_HANDS) - if(L[slot_to_string(SLOT_HANDS)] < HANDS_SLOT_AMT) + if(L[CATEGORY_HANDS] < HANDS_SLOT_AMT) return TRUE else - if(L[slot_to_string(slot)] < DEFAULT_SLOT_AMT) + if(L[slot] < DEFAULT_SLOT_AMT) return TRUE #undef DEFAULT_SLOT_AMT diff --git a/modular_citadel/code/modules/client/loadout/_service.dm b/modular_citadel/code/modules/client/loadout/_service.dm index 89bca0b505..8949c04604 100644 --- a/modular_citadel/code/modules/client/loadout/_service.dm +++ b/modular_citadel/code/modules/client/loadout/_service.dm @@ -14,6 +14,7 @@ /datum/gear/head/neethelm name = "D.A.B. helmet" path = /obj/item/clothing/head/assu_helmet + subcategory = SUBCATEGORY_HEAD_JOBS restricted_roles = list("Assistant") cost = 2 diff --git a/modular_citadel/code/modules/client/loadout/backpack.dm b/modular_citadel/code/modules/client/loadout/backpack.dm index 197005bf45..fe308f5b23 100644 --- a/modular_citadel/code/modules/client/loadout/backpack.dm +++ b/modular_citadel/code/modules/client/loadout/backpack.dm @@ -1,6 +1,7 @@ /datum/gear/backpack category = CATEGORY_BACKPACK subcategory = SUBCATEGORY_BACKPACK_GENERAL + slot = SLOT_IN_BACKPACK /datum/gear/backpack/plushbox name = "Plushie Choice Box" diff --git a/modular_citadel/code/modules/client/loadout/glasses.dm b/modular_citadel/code/modules/client/loadout/glasses.dm index 75c9fff3c1..65bb7ad23c 100644 --- a/modular_citadel/code/modules/client/loadout/glasses.dm +++ b/modular_citadel/code/modules/client/loadout/glasses.dm @@ -1,5 +1,6 @@ /datum/gear/glasses category = CATEGORY_GLASSES + slot = SLOT_GLASSES /datum/gear/glasses/blindfold name = "Blindfold" diff --git a/modular_citadel/code/modules/client/loadout/gloves.dm b/modular_citadel/code/modules/client/loadout/gloves.dm index b6074d91ea..43323af43c 100644 --- a/modular_citadel/code/modules/client/loadout/gloves.dm +++ b/modular_citadel/code/modules/client/loadout/gloves.dm @@ -1,5 +1,6 @@ /datum/gear/gloves category = CATEGORY_GLOVES + slot = SLOT_GLOVES /datum/gear/gloves/fingerless name = "Fingerless Gloves" diff --git a/modular_citadel/code/modules/client/loadout/hands.dm b/modular_citadel/code/modules/client/loadout/hands.dm index 04ab020779..ff4827e6bc 100644 --- a/modular_citadel/code/modules/client/loadout/hands.dm +++ b/modular_citadel/code/modules/client/loadout/hands.dm @@ -1,5 +1,6 @@ /datum/gear/hands category = CATEGORY_HANDS + slot = SLOT_HANDS /datum/gear/hands/cane name = "Cane" diff --git a/modular_citadel/code/modules/client/loadout/head.dm b/modular_citadel/code/modules/client/loadout/head.dm index d0dd03f61b..ef2d7a2680 100644 --- a/modular_citadel/code/modules/client/loadout/head.dm +++ b/modular_citadel/code/modules/client/loadout/head.dm @@ -1,6 +1,7 @@ /datum/gear/head category = CATEGORY_HEAD subcategory = SUBCATEGORY_HEAD_GENERAL + slot = SLOT_HEAD /datum/gear/head/baseball name = "Ballcap" diff --git a/modular_citadel/code/modules/client/loadout/mask.dm b/modular_citadel/code/modules/client/loadout/mask.dm index bce2bd2939..ec77eba93c 100644 --- a/modular_citadel/code/modules/client/loadout/mask.dm +++ b/modular_citadel/code/modules/client/loadout/mask.dm @@ -1,5 +1,6 @@ /datum/gear/mask category = CATEGORY_MASK + slot = SLOT_WEAR_MASK /datum/gear/mask/balaclava name = "Balaclava" diff --git a/modular_citadel/code/modules/client/loadout/neck.dm b/modular_citadel/code/modules/client/loadout/neck.dm index ac399b4287..2e8ec7001d 100644 --- a/modular_citadel/code/modules/client/loadout/neck.dm +++ b/modular_citadel/code/modules/client/loadout/neck.dm @@ -1,6 +1,7 @@ /datum/gear/neck category = CATEGORY_NECK subcategory = SUBCATEGORY_NECK_GENERAL + slot = SLOT_NECK /datum/gear/neck/bluetie name = "Blue tie" diff --git a/modular_citadel/code/modules/client/loadout/shoes.dm b/modular_citadel/code/modules/client/loadout/shoes.dm index f4fa32206c..f92ccbe17c 100644 --- a/modular_citadel/code/modules/client/loadout/shoes.dm +++ b/modular_citadel/code/modules/client/loadout/shoes.dm @@ -1,5 +1,6 @@ /datum/gear/shoes category = CATEGORY_SHOES + slot = SLOT_SHOES /datum/gear/shoes/laceup name = "Laceup shoes" diff --git a/modular_citadel/code/modules/client/loadout/suit.dm b/modular_citadel/code/modules/client/loadout/suit.dm index 4b0c8f8776..a461a86784 100644 --- a/modular_citadel/code/modules/client/loadout/suit.dm +++ b/modular_citadel/code/modules/client/loadout/suit.dm @@ -1,6 +1,7 @@ /datum/gear/suit category = CATEGORY_SUIT subcategory = SUBCATEGORY_SUIT_GENERAL + slot = SLOT_WEAR_SUIT /datum/gear/suit/poncho name = "Poncho" diff --git a/modular_citadel/code/modules/client/loadout/uniform.dm b/modular_citadel/code/modules/client/loadout/uniform.dm index c3ac124b9e..ca4462321f 100644 --- a/modular_citadel/code/modules/client/loadout/uniform.dm +++ b/modular_citadel/code/modules/client/loadout/uniform.dm @@ -1,36 +1,38 @@ /datum/gear/uniform category = CATEGORY_UNIFORM subcategory = SUBCATEGORY_UNIFORM_GENERAL + slot = SLOT_W_UNIFORM -/datum/gear/uniform/suitblack +/datum/gear/uniform/suit name = "Black suit" path = /obj/item/clothing/under/suit/black + subcategory = SUBCATEGORY_UNIFORM_SUITS -/datum/gear/uniform/suitgreen +/datum/gear/uniform/suit/green name = "Green suit" path = /obj/item/clothing/under/suit/green -/datum/gear/uniform/suitred +/datum/gear/uniform/suit/red name = "Red suit" path = /obj/item/clothing/under/suit/red -/datum/gear/uniform/suitcharcoal +/datum/gear/uniform/suit/charcoal name = "Charcoal suit" path = /obj/item/clothing/under/suit/charcoal -/datum/gear/uniform/suitnavy +/datum/gear/uniform/suit/navy name = "Navy suit" path = /obj/item/clothing/under/suit/navy -/datum/gear/uniform/suitburgundy +/datum/gear/uniform/suit/burgundy name = "Burgundy suit" path = /obj/item/clothing/under/suit/burgundy -/datum/gear/uniform/suittan +/datum/gear/uniform/suit/tan name = "Tan suit" path = /obj/item/clothing/under/suit/tan -/datum/gear/uniform/suitwhite +/datum/gear/uniform/suit/white name = "White suit" path = /obj/item/clothing/under/suit/white @@ -46,23 +48,24 @@ name = "Mailman's jumpsuit" path = /obj/item/clothing/under/misc/mailman -/datum/gear/uniform/skirtblack +/datum/gear/uniform/skirt name = "Black skirt" path = /obj/item/clothing/under/dress/skirt + subcategory = SUBCATEGORY_UNIFORM_SKIRTS -/datum/gear/uniform/skirtblue +/datum/gear/uniform/skirt/blue name = "Blue skirt" path = /obj/item/clothing/under/dress/skirt/blue -/datum/gear/uniform/skirtred +/datum/gear/uniform/skirt/red name = "Red skirt" path = /obj/item/clothing/under/dress/skirt/red -/datum/gear/uniform/skirtpurple +/datum/gear/uniform/skirt/purple name = "Purple skirt" path = /obj/item/clothing/under/dress/skirt/purple -/datum/gear/uniform/skirtplaid +/datum/gear/uniform/skirt/plaid name = "Plaid skirt" path = /obj/item/clothing/under/dress/skirt/plaid @@ -82,31 +85,32 @@ name = "Orange Schoolgirl Uniform" path = /obj/item/clothing/under/costume/schoolgirl/orange -/datum/gear/uniform/stripeddress +/datum/gear/uniform/dress name = "Striped Dress" path = /obj/item/clothing/under/dress/striped + subcategory = SUBCATEGORY_UNIFORM_DRESSES -/datum/gear/uniform/sundresswhite +/datum/gear/uniform/dress/sun/white name = "White Sundress" path = /obj/item/clothing/under/dress/sundress/white -/datum/gear/uniform/sundress +/datum/gear/uniform/dress/sun name = "Sundress" path = /obj/item/clothing/under/dress/sundress -/datum/gear/uniform/greendress +/datum/gear/uniform/dress/green name = "Green Dress" path = /obj/item/clothing/under/dress/green -/datum/gear/uniform/pinkdress +/datum/gear/uniform/dress/pink name = "Pink Dress" path = /obj/item/clothing/under/dress/pink -/datum/gear/uniform/flowerdress +/datum/gear/uniform/dress/orange name = "Flower Dress" path = /obj/item/clothing/under/dress/flower -/datum/gear/uniform/sweptskirt +/datum/gear/uniform/skirt/swept name = "Swept skirt" path = /obj/item/clothing/under/dress/skirt/swept @@ -114,97 +118,96 @@ name = "Croptop" path = /obj/item/clothing/under/croptop -/datum/gear/uniform/yoga +/datum/gear/uniform/pants name = "Yoga Pants" path = /obj/item/clothing/under/pants/yoga + subcategory = SUBCATEGORY_UNIFORM_PANTS /datum/gear/uniform/kilt name = "Kilt" path = /obj/item/clothing/under/costume/kilt -/datum/gear/uniform/camoshorts +/datum/gear/uniform/pants/camo name = "Camo Pants" path = /obj/item/clothing/under/pants/camo -/datum/gear/uniform/athleticshorts +/datum/gear/uniform/shorts name = "Athletic Shorts" path = /obj/item/clothing/under/shorts/red + subcategory = SUBCATEGORY_UNIFORM_SHORTS -/datum/gear/uniform/bjeans +/datum/gear/uniform/pants/bjeans name = "Black Jeans" path = /obj/item/clothing/under/pants/blackjeans -/datum/gear/uniform/cjeans +/datum/gear/uniform/pants/cjeans name = "Classic Jeans" path = /obj/item/clothing/under/pants/classicjeans -/datum/gear/uniform/khaki +/datum/gear/uniform/pants/khaki name = "Khaki Pants" path = /obj/item/clothing/under/pants/khaki -/datum/gear/uniform/wpants +/datum/gear/uniform/pants/white name = "White Pants" path = /obj/item/clothing/under/pants/white -/datum/gear/uniform/rpants +/datum/gear/uniform/pants/red name = "Red Pants" path = /obj/item/clothing/under/pants/red -/datum/gear/uniform/tpants +/datum/gear/uniform/pants/tan name = "Tan Pants" path = /obj/item/clothing/under/pants/tan -/datum/gear/uniform/trpants +/datum/gear/uniform/pants/track name = "Track Pants" path = /obj/item/clothing/under/pants/track -/datum/gear/uniform/rippedjeans +/datum/gear/uniform/pants/ripped name = "Ripped Jeans" path = /obj/item/clothing/under/pants/jeanripped -/datum/gear/uniform/jeanshort +/datum/gear/uniform/shorts/jean name = "Jean Shorts" path = /obj/item/clothing/under/pants/jeanshort -/datum/gear/uniform/denimskirt +/datum/gear/uniform/skirt/denim name = "Denim Skirt" path = /obj/item/clothing/under/pants/denimskirt -/datum/gear/uniform/yoga - name = "Yoga Pants" - path = /obj/item/clothing/under/pants/yoga - // Pantsless Sweaters /datum/gear/uniform/turtleneck name = "Tactitool Turtleneck" path = /obj/item/clothing/under/syndicate/cosmetic -/datum/gear/uniform/creamsweater +/datum/gear/uniform/sweater name = "Cream Commando Sweater" path = /obj/item/clothing/under/sweater + subcategory = SUBCATEGORY_UNIFORM_SWEATERS -/datum/gear/uniform/blacksweater +/datum/gear/uniform/sweater/black name = "Black Commando Sweater" path = /obj/item/clothing/under/sweater/black -/datum/gear/uniform/purpsweater +/datum/gear/uniform/sweater/purple name = "Purple Commando Sweater" path = /obj/item/clothing/under/sweater/purple -/datum/gear/uniform/greensweater +/datum/gear/uniform/sweater/green name = "Green Commando Sweater" path = /obj/item/clothing/under/sweater/green -/datum/gear/uniform/redsweater +/datum/gear/uniform/sweater/red name = "Red Commando Sweater" path = /obj/item/clothing/under/sweater/red -/datum/gear/uniform/bluesweater +/datum/gear/uniform/sweater/blue name = "Navy Commando Sweater" path = /obj/item/clothing/under/sweater/blue -/datum/gear/uniform/keyholesweater +/datum/gear/uniform/sweater/keyhole name = "Keyhole Sweater" path = /obj/item/clothing/under/misc/keyholesweater @@ -213,17 +216,17 @@ path = /obj/item/clothing/under/misc/polyjumpsuit cost = 2 -/datum/gear/uniform/polyskirt +/datum/gear/uniform/skirt/poly name = "Polychromic Jumpskirt" path = /obj/item/clothing/under/dress/skirt/polychromic cost = 2 -/datum/gear/uniform/polysuit +/datum/gear/uniform/suit/poly name = "Polychromic Button-up Shirt" path = /obj/item/clothing/under/misc/poly_shirt cost = 3 -/datum/gear/uniform/polypleated +/datum/gear/uniform/skirt/poly/pleated name = "Polychromic Pleated Sweaterskirt" path = /obj/item/clothing/under/dress/skirt/polychromic/pleated cost = 3 @@ -233,12 +236,12 @@ path = /obj/item/clothing/under/costume/kilt/polychromic cost = 3 -/datum/gear/uniform/polyshorts +/datum/gear/uniform/shorts/poly name = "Polychromic Shorts" path = /obj/item/clothing/under/misc/polyshorts cost = 3 -/datum/gear/uniform/polyshortpants +/datum/gear/uniform/shorts/poly/athletic name = "Polychromic Athletic Shorts" path = /obj/item/clothing/under/shorts/polychromic cost = 2 @@ -473,29 +476,35 @@ /datum/gear/uniform/qipao name = "Qipao, Black" path = /obj/item/clothing/under/costume/qipao + subcategory = SUBCATEGORY_UNIFORM_DRESSES cost = 3 /datum/gear/uniform/qipao/white name = "Qipao, White" path = /obj/item/clothing/under/costume/qipao/white + subcategory = SUBCATEGORY_UNIFORM_DRESSES cost = 3 /datum/gear/uniform/qipao/red name = "Qipao, Red" path = /obj/item/clothing/under/costume/qipao/red + subcategory = SUBCATEGORY_UNIFORM_DRESSES cost = 3 /datum/gear/uniform/cheongsam name = "Cheongsam, Black" path = /obj/item/clothing/under/costume/cheongsam + subcategory = SUBCATEGORY_UNIFORM_DRESSES cost = 3 /datum/gear/uniform/cheongsam/white name = "Cheongsam, White" path = /obj/item/clothing/under/costume/cheongsam/white + subcategory = SUBCATEGORY_UNIFORM_DRESSES cost = 3 /datum/gear/uniform/cheongsam/red name = "Cheongsam, Red" path = /obj/item/clothing/under/costume/cheongsam/red + subcategory = SUBCATEGORY_UNIFORM_DRESSES cost = 3