Merge pull request #12960 from timothyteakettle/loadout-you-say

loadout changes part 1: adds subcategories to the loadout
This commit is contained in:
silicons
2020-08-06 21:59:13 -07:00
committed by GitHub
33 changed files with 799 additions and 758 deletions
+56
View File
@@ -0,0 +1,56 @@
//defines for loadout categories
//no category defines
#define NOCATEGORY list("NOCATEGORY")
#define NOSUBCATEGORY list("NOSUBCATEGORY")
//backpack
#define CATEGORY_BACKPACK "In backpack"
#define SUBCATEGORY_BACKPACK_GENERAL "General" //basically anything that there's not enough of to have its own subcategory
#define SUBCATEGORY_BACKPACK_TOYS "Toys"
//neck
#define CATEGORY_NECK "Neck"
#define SUBCATEGORY_NECK_GENERAL "General"
#define SUBCATEGORY_NECK_TIE "Ties"
#define SUBCATEGORY_NECK_SCARVES "Scarves"
//mask
#define CATEGORY_MASK "Mask"
//hands
#define CATEGORY_HANDS "Hands"
//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"
#define SUBCATEGORY_SUIT_GENERAL "General"
#define SUBCATEGORY_SUIT_COATS "Coats"
#define SUBCATEGORY_SUIT_JACKETS "Jackets"
#define SUBCATEGORY_SUIT_JOBS "Jobs"
//head
#define CATEGORY_HEAD "Head"
#define SUBCATEGORY_HEAD_GENERAL "General"
#define SUBCATEGORY_HEAD_JOBS "Jobs"
//shoes
#define CATEGORY_SHOES "Shoes"
//gloves
#define CATEGORY_GLOVES "Gloves"
//glasses
#define CATEGORY_GLASSES "Glasses"
//donator items
#define CATEGORY_DONATOR "Donator"
@@ -0,0 +1,13 @@
GLOBAL_LIST_INIT(loadout_categories, list(
CATEGORY_BACKPACK = list(SUBCATEGORY_BACKPACK_GENERAL, SUBCATEGORY_BACKPACK_TOYS),
CATEGORY_NECK = list(SUBCATEGORY_NECK_GENERAL, SUBCATEGORY_NECK_TIE, SUBCATEGORY_NECK_SCARVES),
CATEGORY_MASK = NOSUBCATEGORY,
CATEGORY_HANDS = NOSUBCATEGORY,
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 = NOSUBCATEGORY,
CATEGORY_GLOVES = NOSUBCATEGORY,
CATEGORY_GLASSES = NOSUBCATEGORY,
CATEGORY_DONATOR = 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[slot_to_string(initial(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
+2 -1
View File
@@ -40,7 +40,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
//If it's 0, that's good, if it's anything but 0, the owner of this prefs file's antag choices were,
//autocorrected this round, not that you'd need to check that.
var/UI_style = null
var/buttons_locked = FALSE
var/hotkeys = FALSE
@@ -1065,6 +1064,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<tr><td colspan=4><center><b><font color='[gear_points == 0 ? "#E62100" : "#CCDDFF"]'>[gear_points]</font> loadout points remaining.</b> \[<a href='?_src_=prefs;preference=gear;clear_loadout=1'>Clear Loadout</a>\]</center></td></tr>"
dat += "<tr><td colspan=4><center>You can only choose one item per category, unless it's an item that spawns in your backpack or hands.</center></td></tr>"
dat += "<tr><td colspan=4><center><b>"
var/firstcat = TRUE
for(var/i in GLOB.loadout_items)
if(firstcat)
@@ -1075,6 +1075,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += " <span class='linkOn'>[i]</span> "
else
dat += " <a href='?_src_=prefs;preference=gear;select_category=[i]'>[i]</a> "
dat += "</b></center></td></tr>"
dat += "<tr><td colspan=4><hr></td></tr>"
dat += "<tr><td colspan=4><b><center>[gear_tab]</center></b></td></tr>"
+2 -2
View File
@@ -224,7 +224,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
var/needs_update = savefile_needs_update(S)
if(needs_update == -2) //fatal, can't load any data
return 0
. = TRUE
//general preferences
@@ -443,7 +443,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
return 0
. = TRUE
//Species
var/species_id
S["species"] >> species_id
+13
View File
@@ -469,3 +469,16 @@
icon_state = "maid"
item_state = "maid"
dynamic_hair_suffix = ""
/obj/item/clothing/head/widered
name = "Wide red hat"
desc = "It is both wide, and red. Stylish!"
icon_state = "widehat_red"
item_state = "widehat_red"
/obj/item/clothing/head/kabuto
name = "Kabuto helmet"
desc = "A traditional kabuto helmet."
icon_state = "kabuto"
item_state = "kabuto"
flags_inv = HIDEHAIR|HIDEEARS
@@ -1057,3 +1057,9 @@
desc = "Reminds you of someone, but you just can't put your finger on it..."
icon_state = "waldo_shirt"
item_state = "waldo_shirt"
/obj/item/clothing/suit/samurai
name = "Samurai outfit"
desc = "An outfit used by traditional japanese warriors."
icon_state = "samurai"
item_state = "samurai"
+26
View File
@@ -329,3 +329,29 @@
desc = "cloud"
icon_state = "cloud"
can_adjust = FALSE
/obj/item/clothing/under/costume/kimono
name = "Kimono"
desc = "A traditional piece of clothing from japan"
icon_state = "kimono"
item_state = "kimono"
/obj/item/clothing/under/costume/kimono/black
name = "Black Kimono"
icon_state = "kimono_a"
item_state = "kimono_a"
/obj/item/clothing/under/costume/kimono/kamishimo
name = "Kamishimo"
icon_state = "kamishimo"
item_state = "kamishimo"
/obj/item/clothing/under/costume/kimono/fancy
name = "Fancy Kimono"
icon_state = "fancy_kimono"
item_state = "fancy_kimono"
/obj/item/clothing/under/costume/kimono/sakura
name = "Sakura Kimono'"
icon_state = "sakura_kimono"
item_state = "sakura_kimono"
@@ -308,3 +308,21 @@
icon_state = "polyfemtankpantsu"
poly_states = 2
poly_colors = list("#808080", "#FF3535")
/obj/item/clothing/under/misc/black_dress
name = "little black dress"
desc = "A small black dress"
icon_state = "littleblackdress_s"
item_state = "littleblackdress_s"
/obj/item/clothing/under/misc/pinktutu
name = "pink tutu"
desc = "A pink tutu"
icon_state = "pinktutu_s"
item_state = "pinktutu_s"
/obj/item/clothing/under/misc/bathrobe
name = "bathrobe"
desc = "A blue bathrobe."
icon_state = "bathrobe"
item_state = "bathrobe"