[REFACTOR] Consolidates SLOT_FLAG and SLOT_HUD into one ITEM_SLOT flag (#26743)

* IT WORKS UP UNTIL THIS POINT

* Consolidates SLOT_FLAG and SLOT_HUD into one

* Remove cover_both_ears

* SLOT_HUD to ITEM_SLOT

* Remove clothing_trait changes for the time being

* Remove accidental copy-paste

* Re-add no-slip var

* More failure to copy-paste correctly

* Leftover flag

* Combine left and right slot flags where possible

* UNGOOF MY DEFINES, PHAND IS NOT A THING

* Minor spacing changes

* Some more fixes from merge

* Seperates ITEM SLOT AMOUNT into two defines

* ON SECOND THOUGHT LETS NOT DO THAT.

* Addresses Contra's review

* Thank you GREP

* Rename ITEM_SLOT_FEET to ITEM_SLOT_SHOES

* Added a comment to the bitmasks in clothing defines

* Rename ITEM_SLOT_TIE to ITEM_SLOT_ACCESSORY

* These are for a seperate PR.

* Magboot fixes

* Requested changes

* Re-add accidental removal

* Wrong flags

* Update code/__DEFINES/clothing_defines.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Signed-off-by: Chap <erwin@lombok.demon.nl>

* Requested changes

* Merge fixes

* Fix double headset

* Fixes multiple accessories

---------

Signed-off-by: Chap <erwin@lombok.demon.nl>
Co-authored-by: Adrer <adrermail@gmail.com>
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
This commit is contained in:
Chap
2024-11-13 13:02:29 +00:00
committed by GitHub
co-authored by Contrabang Adrer
parent c297dde150
commit d90a70ecda
232 changed files with 1231 additions and 1192 deletions
+1 -1
View File
@@ -67,7 +67,7 @@
/datum/component/parry/proc/equipped(datum/source, mob/user, slot)
SIGNAL_HANDLER
if(slot in list(SLOT_HUD_LEFT_HAND, SLOT_HUD_RIGHT_HAND))
if(slot & ITEM_SLOT_BOTH_HANDS)
RegisterSignal(user, COMSIG_HUMAN_PARRY, PROC_REF(start_parry))
else
UnregisterSignal(user, COMSIG_HUMAN_PARRY)
+1 -1
View File
@@ -111,7 +111,7 @@
/datum/component/shielded/proc/on_equipped(datum/source, mob/user, slot)
SIGNAL_HANDLER
if((slot == SLOT_HUD_LEFT_HAND || slot == SLOT_HUD_RIGHT_HAND) && !shield_inhand)
if((slot & ITEM_SLOT_BOTH_HANDS) && !shield_inhand)
lost_wearer(source, user)
return
set_wearer(user)
+2 -2
View File
@@ -126,7 +126,7 @@
/datum/component/two_handed/proc/on_equip(datum/source, mob/user, slot)
SIGNAL_HANDLER // COMSIG_ITEM_EQUIPPED
if(require_twohands && (slot == SLOT_HUD_LEFT_HAND || slot == SLOT_HUD_RIGHT_HAND)) // force equip the item
if(require_twohands && (slot & ITEM_SLOT_BOTH_HANDS)) // force equip the item
INVOKE_ASYNC(src, PROC_REF(wield), user)
if(!user.is_holding(parent) && wielded && !require_twohands)
INVOKE_ASYNC(src, PROC_REF(unwield), user)
@@ -277,7 +277,7 @@
parent_item.update_appearance()
if(istype(user)) // tk showed that we might not have a mob here
if(user.get_item_by_slot(SLOT_HUD_BACK) == parent)
if(user.get_item_by_slot(ITEM_SLOT_BACK) == parent)
user.update_inv_back()
else
user.update_inv_l_hand()