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