mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
[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:
@@ -74,13 +74,13 @@
|
||||
to_chat(user, "<span class='warning'>[part.name] already deployed!</span>")
|
||||
playsound(src, 'sound/machines/scanbuzz.ogg', 25, TRUE, SILENCED_SOUND_EXTRARANGE)
|
||||
if(part in overslotting_parts)
|
||||
var/obj/item/overslot = wearer.get_item_by_slot(slot_bitfield_to_slot(part.slot_flags))
|
||||
var/obj/item/overslot = wearer.get_item_by_slot(part.slot_flags)
|
||||
if(overslot)
|
||||
wearer.unEquip(overslot, TRUE)
|
||||
overslotting_parts[part] = overslot
|
||||
overslot.forceMove(part)
|
||||
RegisterSignal(part, COMSIG_ATOM_EXITED, PROC_REF(on_overslot_exit))
|
||||
if(wearer.equip_to_slot_if_possible(part, slot_bitfield_to_slot(part.slot_flags), disable_warning = TRUE))
|
||||
if(wearer.equip_to_slot_if_possible(part, part.slot_flags, disable_warning = TRUE))
|
||||
part.flags |= NODROP
|
||||
if(mass)
|
||||
return TRUE
|
||||
@@ -109,7 +109,7 @@
|
||||
if(overslotting_parts[part])
|
||||
UnregisterSignal(part, COMSIG_ATOM_EXITED)
|
||||
var/obj/item/overslot = overslotting_parts[part]
|
||||
if(!wearer.equip_to_slot_if_possible(overslot, slot_bitfield_to_slot(overslot.slot_flags), disable_warning = TRUE))
|
||||
if(!wearer.equip_to_slot_if_possible(overslot, overslot.slot_flags, disable_warning = TRUE))
|
||||
overslot.forceMove(get_turf(wearer))
|
||||
overslotting_parts[part] = null
|
||||
if(mass)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
item_state = "mod_control"
|
||||
base_icon_state = "control"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
slot_flags = SLOT_FLAG_BACK
|
||||
slot_flags = ITEM_SLOT_BACK
|
||||
strip_delay = 10 SECONDS
|
||||
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, RAD = 0, FIRE = 0, ACID = 0)
|
||||
actions_types = list(
|
||||
@@ -231,14 +231,14 @@
|
||||
|
||||
/obj/item/mod/control/equipped(mob/user, slot)
|
||||
..()
|
||||
if(slot == SLOT_HUD_BACK)
|
||||
if(slot == ITEM_SLOT_BACK)
|
||||
set_wearer(user)
|
||||
else if(wearer)
|
||||
unset_wearer()
|
||||
|
||||
|
||||
/obj/item/mod/control/item_action_slot_check(slot)
|
||||
if(slot == SLOT_HUD_BACK)
|
||||
if(slot == ITEM_SLOT_BACK)
|
||||
return TRUE
|
||||
|
||||
/obj/item/mod/control/on_mob_move(direction, mob/user)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
/// Default skin of the MOD.
|
||||
var/default_skin = "standard"
|
||||
/// The slot this mod theme fits on
|
||||
var/slot_flags = SLOT_FLAG_BACK
|
||||
var/slot_flags = ITEM_SLOT_BACK
|
||||
/// Armor shared across the MOD parts.
|
||||
var/obj/item/mod/armor/armor_type_1 = /obj/item/mod/armor/mod_theme
|
||||
/// the actual armor object placed in a datum as I am tired and I just want this to work
|
||||
|
||||
@@ -51,9 +51,9 @@
|
||||
if(!ishuman(user))
|
||||
return
|
||||
var/mob/living/carbon/human/human_user = user
|
||||
if(human_user.get_item_by_slot(SLOT_HUD_BACK) && !human_user.unEquip(human_user.get_item_by_slot(SLOT_HUD_BACK)))
|
||||
if(human_user.get_item_by_slot(ITEM_SLOT_BACK) && !human_user.unEquip(human_user.get_item_by_slot(ITEM_SLOT_BACK)))
|
||||
return
|
||||
if(!human_user.equip_to_slot_if_possible(mod, SLOT_HUD_BACK, disable_warning = TRUE))
|
||||
if(!human_user.equip_to_slot_if_possible(mod, ITEM_SLOT_BACK, disable_warning = TRUE))
|
||||
return
|
||||
mod.quick_deploy(user)
|
||||
human_user.update_action_buttons(TRUE)
|
||||
|
||||
Reference in New Issue
Block a user