diff --git a/code/__DEFINES/dcs/signals/signals_storage.dm b/code/__DEFINES/dcs/signals/signals_storage.dm index 26459ab4dad..98fc7801850 100644 --- a/code/__DEFINES/dcs/signals/signals_storage.dm +++ b/code/__DEFINES/dcs/signals/signals_storage.dm @@ -5,6 +5,11 @@ /// Sent after dumping into some other storage object: (atom/dest_object, mob/user) #define COMSIG_STORAGE_DUMP_POST_TRANSFER "storage_dump_into_storage" +/// Sent before storing an item (obj/item/being_stored, mob/user, force, messages) +#define COMSIG_ATOM_PRE_STORED_ITEM "atom_pre_storing_item" + /// Return to block the item from being stored. + #define BLOCK_STORAGE_INSERT (1<<0) + /// Fired off the storage's PARENT when an ITEM is STORED INSIDE. (obj/item, mob, force) #define COMSIG_ATOM_STORED_ITEM "atom_storing_item" diff --git a/code/datums/storage/storage.dm b/code/datums/storage/storage.dm index 17338ba53b6..44c4571aa80 100644 --- a/code/datums/storage/storage.dm +++ b/code/datums/storage/storage.dm @@ -171,6 +171,16 @@ remove_all(update_storage = FALSE) +/// Ran on items instantiated inside the storage, basically a chopped down version of handle_enter +/datum/storage/proc/item_init(datum/source, obj/item/inited) + SIGNAL_HANDLER + + if(!istype(inited)) + return + + inited.item_flags |= IN_STORAGE + RegisterSignal(inited, COMSIG_MOUSEDROPPED_ONTO, PROC_REF(mousedrop_receive)) + /// Automatically ran on all object insertions: flag marking and view refreshing. /datum/storage/proc/handle_enter(datum/source, obj/item/arrived) SIGNAL_HANDLER @@ -223,6 +233,7 @@ RegisterSignal(parent, COMSIG_ATOM_EMP_ACT, PROC_REF(on_emp_act)) RegisterSignal(parent, COMSIG_ATOM_CONTENTS_WEIGHT_CLASS_CHANGED, PROC_REF(contents_changed_w_class)) RegisterSignal(parent, COMSIG_CLICK_ALT, PROC_REF(on_click_alt)) + RegisterSignal(parent, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON, PROC_REF(item_init)) /** * Sets where items are physically being stored in the case it shouldn't be on the parent. @@ -476,6 +487,8 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches) if(!can_insert(to_insert, user, messages = messages, force = force)) return FALSE + if(SEND_SIGNAL(parent, COMSIG_ATOM_PRE_STORED_ITEM, to_insert, user, force, messages) & BLOCK_STORAGE_INSERT) + return FALSE SEND_SIGNAL(parent, COMSIG_ATOM_STORED_ITEM, to_insert, user, force) SEND_SIGNAL(src, COMSIG_STORAGE_STORED_ITEM, to_insert, user, force) diff --git a/code/datums/storage/subtypes/bags.dm b/code/datums/storage/subtypes/bags.dm index 95ae354bcfd..1d1c432cd81 100644 --- a/code/datums/storage/subtypes/bags.dm +++ b/code/datums/storage/subtypes/bags.dm @@ -268,12 +268,51 @@ /datum/storage/bag/garment numerical_stacking = FALSE max_total_storage = 200 - max_slots = 15 + max_slots = 20 insert_preposition = "in" + allow_big_nesting = TRUE /datum/storage/bag/garment/New(atom/parent, max_slots, max_specific_storage, max_total_storage, rustle_sound, remove_rustle_sound) . = ..() - set_holdable(/obj/item/clothing) + set_holdable( + can_hold_list = list(/obj/item/clothing, /obj/item/storage/backpack), + exception_hold_list = list(/obj/item/storage/backpack), + ) + +/datum/storage/bag/garment/can_insert(obj/item/to_insert, mob/user, messages, force) + . = ..() + if(!.) + return FALSE + + if(istype(to_insert, /obj/item/storage/backpack) && length(to_insert.contents)) + if(messages && user) + parent.balloon_alert(user, "can't store filled backpacks!") + return FALSE + + return TRUE + +/datum/storage/bag/garment/item_init(datum/source, obj/item/inited) + . = ..() + if(!istype(inited, /obj/item/storage/backpack)) + return + RegisterSignal(inited, COMSIG_ATOM_PRE_STORED_ITEM, PROC_REF(block_inner_storage)) + +/datum/storage/bag/garment/handle_enter(datum/source, obj/item/arrived) + . = ..() + if(!istype(arrived, /obj/item/storage/backpack)) + return + RegisterSignal(arrived, COMSIG_ATOM_PRE_STORED_ITEM, PROC_REF(block_inner_storage)) + +/datum/storage/bag/garment/handle_exit(datum/source, obj/item/gone) + . = ..() + UnregisterSignal(gone, COMSIG_ATOM_PRE_STORED_ITEM) + +/datum/storage/bag/garment/proc/block_inner_storage(obj/item/backpack, to_insert, user, force, messages) + SIGNAL_HANDLER + + if(user && messages) + parent.balloon_alert(user, "garment bag is in the way!") + return BLOCK_STORAGE_INSERT ///Quiver bag /datum/storage/bag/quiver diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index 13a7a9ce1f3..8310bffc8d5 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -140,6 +140,12 @@ icon_state = "backpack-medical" inhand_icon_state = "medicalpack" +/obj/item/storage/backpack/chief_medic + name = "chief medical officer's backpack" + desc = "A backpack with just enough pockets to carry the chief medical officer's equipment." + icon_state = "backpack-chiefmedical" + inhand_icon_state = "medicalpack" + /obj/item/storage/backpack/coroner name = "coroner backpack" desc = "It's a backpack especially designed for use in an undead environment." @@ -315,6 +321,12 @@ icon_state = "satchel-medical" inhand_icon_state = "satchel-med" +/obj/item/storage/backpack/satchel/chief_medic + name = "chief medical officer's satchel" + desc = "A satchel with barely enough pockets to carry the chief medical officer's equipment." + icon_state = "satchel-chiefmedical" + inhand_icon_state = "satchel-med" + /obj/item/storage/backpack/satchel/vir name = "virologist satchel" desc = "A sterile satchel with virologist colours." @@ -420,6 +432,12 @@ icon_state = "messenger_medical" inhand_icon_state = "messenger_medical" +/obj/item/storage/backpack/messenger/chief_medic + name = "chief medical officer's messenger bag" + desc = "A slim messenger bag appreciated by chief medical officers for staying out of their way while working - unlike their chemists." + icon_state = "messenger_chiefmedical" + inhand_icon_state = "messenger_medical" + /obj/item/storage/backpack/messenger/vir name = "virologist messenger bag" desc = "A sterile messenger bag with virologist colours, useful for deploying biohazards in record times." diff --git a/code/game/objects/items/storage/dufflebags.dm b/code/game/objects/items/storage/dufflebags.dm index 159f581a76d..15eaf089d30 100644 --- a/code/game/objects/items/storage/dufflebags.dm +++ b/code/game/objects/items/storage/dufflebags.dm @@ -132,6 +132,12 @@ icon_state = "duffel-medical" inhand_icon_state = "duffel-med" +/obj/item/storage/backpack/duffelbag/chief_medic + name = "chief medical officer's duffel bag" + desc = "A large duffel bag for handling the duties of the entire medical department at once." + icon_state = "duffel-chiefmedical" + inhand_icon_state = "duffel-med" + /obj/item/storage/backpack/duffelbag/coroner name = "coroner duffel bag" desc = "A large duffel bag for holding large amounts of organs at once." diff --git a/code/game/objects/items/storage/garment.dm b/code/game/objects/items/storage/garment.dm index 971e30818ae..7d059b612dc 100644 --- a/code/game/objects/items/storage/garment.dm +++ b/code/game/objects/items/storage/garment.dm @@ -54,6 +54,10 @@ new /obj/item/clothing/head/hats/caphat/parade(src) new /obj/item/clothing/neck/cloak/cap(src) new /obj/item/clothing/shoes/laceup(src) + new /obj/item/storage/backpack/captain(src) + new /obj/item/storage/backpack/satchel/cap(src) + new /obj/item/storage/backpack/duffelbag/captain(src) + new /obj/item/storage/backpack/messenger/cap(src) /obj/item/storage/bag/garment/hop/PopulateContents() new /obj/item/clothing/under/rank/civilian/head_of_personnel(src) @@ -121,7 +125,11 @@ new /obj/item/clothing/head/beret/medical/cmo(src) new /obj/item/clothing/head/utility/surgerycap/cmo(src) new /obj/item/clothing/neck/cloak/cmo(src) - new /obj/item/clothing/shoes/sneakers/blue (src) + new /obj/item/clothing/shoes/sneakers/white(src) + new /obj/item/storage/backpack/chief_medic(src) + new /obj/item/storage/backpack/satchel/chief_medic(src) + new /obj/item/storage/backpack/duffelbag/chief_medic(src) + new /obj/item/storage/backpack/messenger/chief_medic(src) /obj/item/storage/bag/garment/engineering_chief/PopulateContents() new /obj/item/clothing/under/rank/engineering/chief_engineer(src) diff --git a/code/game/objects/items/storage/storage.dm b/code/game/objects/items/storage/storage.dm index d9e2fe3ae67..957d6f2e355 100644 --- a/code/game/objects/items/storage/storage.dm +++ b/code/game/objects/items/storage/storage.dm @@ -19,9 +19,6 @@ PopulateContents() - for (var/obj/item/item in src) - item.item_flags |= IN_STORAGE - /obj/item/storage/create_storage( max_slots, max_specific_storage, diff --git a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm index 08463193181..7b96c44c2fb 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm @@ -90,7 +90,6 @@ new /obj/item/door_remote/chief_medical_officer(src) new /obj/item/clothing/neck/petcollar(src) new /obj/item/pet_carrier(src) - new /obj/item/wallframe/defib_mount(src) new /obj/item/circuitboard/machine/techfab/department/medical(src) new /obj/item/storage/photo_album/cmo(src) new /obj/item/storage/lockbox/medal/med(src) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/security.dm b/code/game/objects/structures/crates_lockers/closets/secure/security.dm index 51a41063e71..97e76f53a8a 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/security.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/security.dm @@ -5,11 +5,6 @@ /obj/structure/closet/secure_closet/captains/PopulateContents() ..() - - new /obj/item/storage/backpack/captain(src) - new /obj/item/storage/backpack/satchel/cap(src) - new /obj/item/storage/backpack/duffelbag/captain(src) - new /obj/item/storage/backpack/messenger/cap(src) new /obj/item/clothing/neck/petcollar(src) new /obj/item/pet_carrier(src) new /obj/item/storage/bag/garment/captain(src) diff --git a/code/modules/jobs/job_types/chief_medical_officer.dm b/code/modules/jobs/job_types/chief_medical_officer.dm index b28c6c3e428..eda435e2aec 100644 --- a/code/modules/jobs/job_types/chief_medical_officer.dm +++ b/code/modules/jobs/job_types/chief_medical_officer.dm @@ -66,15 +66,15 @@ ) belt = /obj/item/modular_computer/pda/heads/cmo ears = /obj/item/radio/headset/heads/cmo - shoes = /obj/item/clothing/shoes/sneakers/blue + shoes = /obj/item/clothing/shoes/sneakers/white l_pocket = /obj/item/laser_pointer/blue r_pocket = /obj/item/pinpointer/crew l_hand = /obj/item/storage/medkit/surgery - backpack = /obj/item/storage/backpack/medic - satchel = /obj/item/storage/backpack/satchel/med - duffelbag = /obj/item/storage/backpack/duffelbag/med - messenger = /obj/item/storage/backpack/messenger/med + backpack = /obj/item/storage/backpack/chief_medic + satchel = /obj/item/storage/backpack/satchel/chief_medic + duffelbag = /obj/item/storage/backpack/duffelbag/chief_medic + messenger = /obj/item/storage/backpack/messenger/chief_medic box = /obj/item/storage/box/survival/medical chameleon_extras = list( diff --git a/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_moth.png b/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_moth.png index ba18a7ec165..355b74df6ac 100644 Binary files a/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_moth.png and b/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_moth.png differ diff --git a/icons/mob/clothing/back/backpack.dmi b/icons/mob/clothing/back/backpack.dmi index 0a5e787dbad..b0ba9a13fe0 100644 Binary files a/icons/mob/clothing/back/backpack.dmi and b/icons/mob/clothing/back/backpack.dmi differ diff --git a/icons/obj/storage/backpack.dmi b/icons/obj/storage/backpack.dmi index fcaf9d8a78a..d464ee689fa 100644 Binary files a/icons/obj/storage/backpack.dmi and b/icons/obj/storage/backpack.dmi differ