subcategories work

This commit is contained in:
timothyteakettle
2020-07-29 03:57:16 +01:00
parent 721e018aec
commit c15d0de20d
10 changed files with 73 additions and 53 deletions

View File

@@ -230,7 +230,7 @@
path = /obj/item/toy/darksabre
ckeywhitelist = list("inferno707")
datum/gear/darksabresheath
/datum/gear/donator/darksabresheath
name = "Dark Sabre Sheath"
slot = SLOT_IN_BACKPACK
path = /obj/item/storage/belt/sabre/darksabre

View File

@@ -26,15 +26,11 @@ GLOBAL_LIST_EMPTY(loadout_whitelist_ids)
/proc/initialize_global_loadout_items()
load_loadout_config()
LAZYINITLIST(GLOB.loadout_items["NOSUBCATEGORY"]) //items without a subcategory just have one that doesnt show
for(var/item in subtypesof(/datum/gear))
var/datum/gear/I = new item
LAZYINITLIST(GLOB.loadout_items[I.category])
if(I.subcategory)
LAZYINITLIST(GLOB.loadout_items[I.category][I.subcategory])
GLOB.loadout_items[I.category][I.subcategory][I.name] = I
else
GLOB.loadout_items[I.category]["NOSUBCATEGORY"][I.name] = I
LAZYINITLIST(GLOB.loadout_items[I.category][I.subcategory])
GLOB.loadout_items[I.category][I.subcategory][I.name] = I
if(islist(I.geargroupID))
var/list/ggidlist = I.geargroupID
I.ckeywhitelist = list()
@@ -47,8 +43,8 @@ GLOBAL_LIST_EMPTY(loadout_whitelist_ids)
/datum/gear
var/name
var/category
var/subcategory
var/category = "NOCATEGORY"
var/subcategory = "NOSUBCATEGORY"
var/slot
var/description
var/path //item-to-spawn path

View File

@@ -32,7 +32,6 @@
/datum/gear/head/nursehat
name = "Nurse Hat"
category = SLOT_HEAD
path = /obj/item/clothing/head/nursehat
subcategory = SUBCATEGORY_HEAD_JOBS
restricted_roles = list("Medical Doctor", "Chief Medical Officer", "Geneticist", "Chemist", "Virologist")
@@ -40,7 +39,6 @@
/datum/gear/uniform/nursesuit
name = "Nurse Suit"
category = SLOT_W_UNIFORM
path = /obj/item/clothing/under/rank/medical/doctor/nurse
subcategory = SUBCATEGORY_UNIFORM_JOBS
restricted_roles = list("Medical Doctor", "Chief Medical Officer", "Geneticist", "Chemist", "Virologist")

View File

@@ -64,36 +64,36 @@
path = /obj/item/storage/crayons
subcategory = SUBCATEGORY_BACKPACK_TOYS
/datum/gear/multipen
/datum/gear/backpack/multipen
name = "A multicolored pen"
path = /obj/item/pen/fourcolor
/datum/gear/fountainpen
/datum/gear/backpack/fountainpen
name = "A fancy pen"
path = /obj/item/pen/fountain
cost = 2
/datum/gear/modular_tablet
/datum/gear/backpack/modular_tablet
name = "A modular tablet"
path = /obj/item/modular_computer/tablet/preset/cheap/
cost = 4
/datum/gear/modular_laptop
/datum/gear/backpack/modular_laptop
name = "A modular laptop"
path = /obj/item/modular_computer/laptop/preset/civilian
cost = 7
/datum/gear/ringbox_gold
/datum/gear/backpack/ringbox_gold
name = "A gold ring box"
path = /obj/item/storage/fancy/ringbox
cost = 3
/datum/gear/ringbox_silver
/datum/gear/backpack/ringbox_silver
name = "A silver ring box"
path = /obj/item/storage/fancy/ringbox/silver
cost = 3
/datum/gear/ringbox_diamond
/datum/gear/backpack/ringbox_diamond
name = "A diamond ring box"
path = /obj/item/storage/fancy/ringbox/diamond
cost = 5

View File

@@ -1,53 +1,53 @@
/datum/gear/hands
category = CATEGORY_HANDS
/datum/gear/cane
/datum/gear/hands/cane
name = "Cane"
path = /obj/item/cane
/datum/gear/cigarettes
/datum/gear/hands/cigarettes
name = "Cigarette pack"
path = /obj/item/storage/fancy/cigarettes
/datum/gear/dice
/datum/gear/hands/dice
name = "Dice bag"
path = /obj/item/storage/box/dice
/datum/gear/eightball
/datum/gear/hands/eightball
name = "Magic eightball"
path = /obj/item/toy/eightball
/datum/gear/matches
/datum/gear/hands/matches
name = "Matchbox"
path = /obj/item/storage/box/matches
/datum/gear/cheaplighter
/datum/gear/hands/cheaplighter
name = "Cheap lighter"
path = /obj/item/lighter/greyscale
/datum/gear/cards
/datum/gear/hands/cards
name = "Playing cards"
path = /obj/item/toy/cards/deck
/datum/gear/skub
/datum/gear/hands/skub
name = "Skub"
path = /obj/item/skub
/datum/gear/wallet
/datum/gear/hands/wallet
name = "Wallet"
path = /obj/item/storage/wallet
/datum/gear/flask
/datum/gear/hands/flask
name = "Flask"
path = /obj/item/reagent_containers/food/drinks/flask
cost = 2
/datum/gear/zippolighter
/datum/gear/hands/zippolighter
name = "Zippo Lighter"
path = /obj/item/lighter
cost = 2
/datum/gear/cigar
/datum/gear/hands/cigar
name = "Cigar"
path = /obj/item/clothing/mask/cigarette/cigar
cost = 4 //smoking is bad mkay

View File

@@ -9,7 +9,7 @@
/datum/gear/neck/redtie
name = "Red tie"
category = SLOT_NECK
subcategory = SUBCATEGORY_NECK_TIE
path = /obj/item/clothing/neck/tie/red
/datum/gear/neck/blacktie
@@ -80,10 +80,8 @@
/datum/gear/neck/headphones
name = "Headphones"
category = SLOT_NECK
path = /obj/item/clothing/ears/headphones
/datum/gear/neck/polycloak
name = "Polychromatic Cloak"
category = SLOT_NECK
path = /obj/item/clothing/neck/cloak/polychromic