Changes slot number defines from lowercase to all uppercase (#22297)

* undo all of it

* flags

* back

* head/mask

* left

* right

* Cuffs

* other name changes

* ID and PDA

* idk about calling them SLOT_HUD now

* glasses, gloves, and shoes, oh my!

* the rest

* comment
This commit is contained in:
Contrabang
2023-10-03 18:27:51 +01:00
committed by GitHub
parent a6a34c2592
commit f3f9bd442a
219 changed files with 1114 additions and 1113 deletions
+56 -56
View File
@@ -206,9 +206,9 @@
src:update_fhair()
/mob/proc/put_in_any_hand_if_possible(obj/item/W as obj, del_on_fail = 0, disable_warning = 1)
if(equip_to_slot_if_possible(W, slot_l_hand, del_on_fail, disable_warning))
if(equip_to_slot_if_possible(W, SLOT_HUD_LEFT_HAND, del_on_fail, disable_warning))
return 1
else if(equip_to_slot_if_possible(W, slot_r_hand, del_on_fail, disable_warning))
else if(equip_to_slot_if_possible(W, SLOT_HUD_RIGHT_HAND, del_on_fail, disable_warning))
return 1
return 0
@@ -268,23 +268,23 @@
//The list of slots by priority. equip_to_appropriate_slot() uses this list. Doesn't matter if a mob type doesn't have a slot.
GLOBAL_LIST_INIT(slot_equipment_priority, list( \
slot_back,\
slot_wear_pda,\
slot_wear_id,\
slot_w_uniform,\
slot_wear_suit,\
slot_wear_mask,\
slot_head,\
slot_shoes,\
slot_gloves,\
slot_l_ear,\
slot_r_ear,\
slot_glasses,\
slot_belt,\
slot_s_store,\
slot_tie,\
slot_l_store,\
slot_r_store\
SLOT_HUD_BACK,\
SLOT_HUD_WEAR_PDA,\
SLOT_HUD_WEAR_ID,\
SLOT_HUD_JUMPSUIT,\
SLOT_HUD_OUTER_SUIT,\
SLOT_HUD_WEAR_MASK,\
SLOT_HUD_HEAD,\
SLOT_HUD_SHOES,\
SLOT_HUD_GLOVES,\
SLOT_HUD_LEFT_EAR,\
SLOT_HUD_RIGHT_EAR,\
SLOT_HUD_GLASSES,\
SLOT_HUD_BELT,\
SLOT_HUD_SUIT_STORE,\
SLOT_HUD_TIE,\
SLOT_HUD_LEFT_STORE,\
SLOT_HUD_RIGHT_STORE\
))
//puts the item "W" into an appropriate slot in a human's inventory
@@ -293,7 +293,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
if(!istype(W)) return 0
for(var/slot in GLOB.slot_equipment_priority)
if(isstorage(W) && slot == slot_head) // Storage items should be put on the belt before the head
if(isstorage(W) && slot == SLOT_HUD_HEAD) // Storage items should be put on the belt before the head
continue
if(equip_to_slot_if_possible(W, slot, FALSE, TRUE)) //del_on_fail = 0; disable_warning = 0
return 1
@@ -317,22 +317,22 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
var/mob/living/carbon/human/H = M
switch(slot)
if(slot_l_hand)
if(SLOT_HUD_LEFT_HAND)
if(H.l_hand)
return 0
return 1
if(slot_r_hand)
if(SLOT_HUD_RIGHT_HAND)
if(H.r_hand)
return 0
return 1
if(slot_wear_mask)
if( !(slot_flags & SLOT_MASK) )
if(SLOT_HUD_WEAR_MASK)
if( !(slot_flags & SLOT_FLAG_MASK) )
return 0
if(H.wear_mask)
return 0
return 1
if(slot_back)
if( !(slot_flags & SLOT_BACK) )
if(SLOT_HUD_BACK)
if( !(slot_flags & SLOT_FLAG_BACK) )
return 0
if(H.back)
if(!(H.back.flags & NODROP))
@@ -340,8 +340,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(slot_wear_suit)
if( !(slot_flags & SLOT_OCLOTHING) )
if(SLOT_HUD_OUTER_SUIT)
if( !(slot_flags & SLOT_FLAG_OCLOTHING) )
return 0
if(H.wear_suit)
if(!(H.wear_suit.flags & NODROP))
@@ -349,8 +349,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(slot_gloves)
if( !(slot_flags & SLOT_GLOVES) )
if(SLOT_HUD_GLOVES)
if( !(slot_flags & SLOT_FLAG_GLOVES) )
return 0
if(H.gloves)
if(!(H.gloves.flags & NODROP))
@@ -358,8 +358,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(slot_shoes)
if( !(slot_flags & SLOT_FEET) )
if(SLOT_HUD_SHOES)
if( !(slot_flags & SLOT_FLAG_FEET) )
return 0
if(H.shoes)
if(!(H.shoes.flags & NODROP))
@@ -367,12 +367,12 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(slot_belt)
if(SLOT_HUD_BELT)
if(!H.w_uniform)
if(!disable_warning)
to_chat(H, "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>")
return 0
if( !(slot_flags & SLOT_BELT) )
if( !(slot_flags & SLOT_FLAG_BELT) )
return 0
if(H.belt)
if(!(H.belt.flags & NODROP))
@@ -380,8 +380,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(slot_glasses)
if( !(slot_flags & SLOT_EYES) )
if(SLOT_HUD_GLASSES)
if( !(slot_flags & SLOT_FLAG_EYES) )
return 0
if(H.glasses)
if(!(H.glasses.flags & NODROP))
@@ -389,8 +389,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(slot_head)
if( !(slot_flags & SLOT_HEAD) )
if(SLOT_HUD_HEAD)
if( !(slot_flags & SLOT_FLAG_HEAD) )
return 0
if(H.head)
if(!(H.head.flags & NODROP))
@@ -398,8 +398,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(slot_l_ear)
if( !(slot_flags & slot_l_ear) )
if(SLOT_HUD_LEFT_EAR)
if( !(slot_flags & SLOT_HUD_LEFT_EAR) )
return 0
if(H.l_ear)
if(!(H.l_ear.flags & NODROP))
@@ -407,8 +407,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(slot_r_ear)
if( !(slot_flags & slot_r_ear) )
if(SLOT_HUD_RIGHT_EAR)
if( !(slot_flags & SLOT_HUD_RIGHT_EAR) )
return 0
if(H.r_ear)
if(!(H.r_ear.flags & NODROP))
@@ -416,8 +416,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(slot_w_uniform)
if( !(slot_flags & SLOT_ICLOTHING) )
if(SLOT_HUD_JUMPSUIT)
if( !(slot_flags & SLOT_FLAG_ICLOTHING) )
return 0
if(H.w_uniform)
if(!(H.w_uniform.flags & NODROP))
@@ -425,12 +425,12 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(slot_wear_id)
if(SLOT_HUD_WEAR_ID)
if(!H.w_uniform)
if(!disable_warning)
to_chat(H, "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>")
return 0
if( !(slot_flags & SLOT_ID) )
if( !(slot_flags & SLOT_FLAG_ID) )
return 0
if(H.wear_id)
if(!(H.wear_id.flags & NODROP))
@@ -438,26 +438,26 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(slot_l_store)
if(SLOT_HUD_LEFT_STORE)
if(H.l_store)
return 0
if(!H.w_uniform)
if(!disable_warning)
to_chat(H, "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>")
return 0
if( w_class <= WEIGHT_CLASS_SMALL || (slot_flags & SLOT_POCKET) )
if( w_class <= WEIGHT_CLASS_SMALL || (slot_flags & SLOT_FLAG_POCKET) )
return 1
if(slot_r_store)
if(SLOT_HUD_RIGHT_STORE)
if(H.r_store)
return 0
if(!H.w_uniform)
if(!disable_warning)
to_chat(H, "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>")
return 0
if( w_class <= WEIGHT_CLASS_SMALL || (slot_flags & SLOT_POCKET) )
if( w_class <= WEIGHT_CLASS_SMALL || (slot_flags & SLOT_FLAG_POCKET) )
return 1
return 0
if(slot_s_store)
if(SLOT_HUD_SUIT_STORE)
if(!H.wear_suit)
if(!disable_warning)
to_chat(H, "<span class='warning'>You need a suit before you can attach this [name].</span>")
@@ -479,19 +479,19 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 1
return 0
if(slot_handcuffed)
if(SLOT_HUD_HANDCUFFED)
if(H.handcuffed)
return 0
if(!istype(src, /obj/item/restraints/handcuffs))
return 0
return 1
if(slot_legcuffed)
if(SLOT_HUD_LEGCUFFED)
if(H.legcuffed)
return 0
if(!istype(src, /obj/item/restraints/legcuffs))
return 0
return 1
if(slot_in_backpack)
if(SLOT_HUD_IN_BACKPACK)
if(H.back && istype(H.back, /obj/item/storage/backpack))
var/obj/item/storage/backpack/B = H.back
if(B.contents.len < B.storage_slots && w_class <= B.max_w_class)
@@ -588,8 +588,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
/mob/proc/show_inv(mob/user)
user.set_machine(src)
var/dat = {"<table>
<tr><td><B>Left Hand:</B></td><td><A href='?src=[UID()];item=[slot_l_hand]'>[(l_hand && !(l_hand.flags&ABSTRACT)) ? html_encode(l_hand) : "<font color=grey>Empty</font>"]</A></td></tr>
<tr><td><B>Right Hand:</B></td><td><A href='?src=[UID()];item=[slot_r_hand]'>[(r_hand && !(r_hand.flags&ABSTRACT)) ? html_encode(r_hand) : "<font color=grey>Empty</font>"]</A></td></tr>
<tr><td><B>Left Hand:</B></td><td><A href='?src=[UID()];item=[SLOT_HUD_LEFT_HAND]'>[(l_hand && !(l_hand.flags&ABSTRACT)) ? html_encode(l_hand) : "<font color=grey>Empty</font>"]</A></td></tr>
<tr><td><B>Right Hand:</B></td><td><A href='?src=[UID()];item=[SLOT_HUD_RIGHT_HAND]'>[(r_hand && !(r_hand.flags&ABSTRACT)) ? html_encode(r_hand) : "<font color=grey>Empty</font>"]</A></td></tr>
<tr><td>&nbsp;</td></tr>"}
dat += {"</table>
<A href='?src=[user.UID()];mach_close=mob\ref[src]'>Close</A>