subcategories cool

This commit is contained in:
Timothy Teakettle
2020-07-29 17:14:07 +01:00
parent c15d0de20d
commit 31963b32a4
15 changed files with 88 additions and 61 deletions
+7 -1
View File
@@ -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"
+1 -1
View File
@@ -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"),
+4 -4
View File
@@ -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
+8 -6
View File
@@ -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 += "<br>"
dat += " |"
if(category_index == category)
dat += " <span class='linkOn'>[i]</span> "
else
@@ -1077,6 +1077,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<tr><td colspan=4><hr></td></tr>"
dat += "<tr><td colspan=4><b><center>[gear_tab]</center></b></td></tr>"
dat += "<tr><td colspan=4><hr></td></tr>"
dat += "<tr><td colspan=4><center><b>"
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 += " <a href='?_src_=prefs;preference=gear;select_subcategory=[subcategory_index]'>[i]</a> "
subcategory_index += 1
dat += "</b></center></td></tr>"
dat += "<tr width=10% style='vertical-align:top;'><td width=15%><b>Name</b></td>"
dat += "<td style='vertical-align:top'><b>Cost</b></td>"
@@ -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
@@ -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
@@ -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"
@@ -1,5 +1,6 @@
/datum/gear/glasses
category = CATEGORY_GLASSES
slot = SLOT_GLASSES
/datum/gear/glasses/blindfold
name = "Blindfold"
@@ -1,5 +1,6 @@
/datum/gear/gloves
category = CATEGORY_GLOVES
slot = SLOT_GLOVES
/datum/gear/gloves/fingerless
name = "Fingerless Gloves"
@@ -1,5 +1,6 @@
/datum/gear/hands
category = CATEGORY_HANDS
slot = SLOT_HANDS
/datum/gear/hands/cane
name = "Cane"
@@ -1,6 +1,7 @@
/datum/gear/head
category = CATEGORY_HEAD
subcategory = SUBCATEGORY_HEAD_GENERAL
slot = SLOT_HEAD
/datum/gear/head/baseball
name = "Ballcap"
@@ -1,5 +1,6 @@
/datum/gear/mask
category = CATEGORY_MASK
slot = SLOT_WEAR_MASK
/datum/gear/mask/balaclava
name = "Balaclava"
@@ -1,6 +1,7 @@
/datum/gear/neck
category = CATEGORY_NECK
subcategory = SUBCATEGORY_NECK_GENERAL
slot = SLOT_NECK
/datum/gear/neck/bluetie
name = "Blue tie"
@@ -1,5 +1,6 @@
/datum/gear/shoes
category = CATEGORY_SHOES
slot = SLOT_SHOES
/datum/gear/shoes/laceup
name = "Laceup shoes"
@@ -1,6 +1,7 @@
/datum/gear/suit
category = CATEGORY_SUIT
subcategory = SUBCATEGORY_SUIT_GENERAL
slot = SLOT_WEAR_SUIT
/datum/gear/suit/poncho
name = "Poncho"
@@ -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