diff --git a/code/datums/elements/update_icon_blocker.dm b/code/datums/elements/update_icon_blocker.dm index 674b314ec9c1..9f73ba704fa5 100644 --- a/code/datums/elements/update_icon_blocker.dm +++ b/code/datums/elements/update_icon_blocker.dm @@ -1,12 +1,22 @@ //Prevents calling anything in update_icon() like update_icon_state() or update_overlays() -/datum/element/update_icon_blocker/Attach(datum/target) +/datum/element/update_icon_blocker + element_flags = ELEMENT_BESPOKE + id_arg_index = 2 + + /// Set of COMSIG_ATOM_UPDATE_ICON to return. See [signals_atom_main.dm] + var/blocking_flags + +/datum/element/update_icon_blocker/Attach(datum/target, blocking_flags = COMSIG_ATOM_NO_UPDATE_ICON_STATE | COMSIG_ATOM_NO_UPDATE_OVERLAYS) . = ..() - if(!istype(target, /atom)) + if(!isatom(target)) return ELEMENT_INCOMPATIBLE + if(!blocking_flags) + CRASH("Attempted to block icon updates with a null blocking_flags argument. Why?") + src.blocking_flags = blocking_flags RegisterSignal(target, COMSIG_ATOM_UPDATE_ICON, PROC_REF(block_update_icon)) /datum/element/update_icon_blocker/proc/block_update_icon() SIGNAL_HANDLER - return COMSIG_ATOM_NO_UPDATE_ICON_STATE | COMSIG_ATOM_NO_UPDATE_OVERLAYS + return blocking_flags diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 0125f3c207c5..a0cf93cba917 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -24,6 +24,8 @@ var/obj/item/reagent_container ///Set false to block beaker use and instead use an internal reagent holder var/use_internal_storage = FALSE + ///If use_internal_storage is true, this is the created volume of the container + var/internal_storage_volume = 100 ///Typecache of containers we accept var/static/list/drip_containers = typecacheof(list( /obj/item/reagent_containers/blood, @@ -38,7 +40,7 @@ . = ..() update_appearance() if(use_internal_storage) - create_reagents(100, TRANSPARENT) + create_reagents(internal_storage_volume, TRANSPARENT) interaction_flags_machine |= INTERACT_MACHINE_OFFLINE /obj/machinery/iv_drip/Destroy() @@ -312,13 +314,16 @@ desc = "An all-you-can-drip saline canister designed to supply a hospital without running out, with a scary looking pump rigged to inject saline into containers, but filling people directly might be a bad idea." icon_state = "saline" base_icon_state = "saline" + use_internal_storage = TRUE + internal_storage_volume = 5000 density = TRUE inject_only = TRUE /obj/machinery/iv_drip/saline/Initialize(mapload) + AddElement(/datum/element/update_icon_blocker, COMSIG_ATOM_NO_UPDATE_OVERLAYS) . = ..() - reagent_container = new /obj/item/reagent_containers/glass/saline(src) - AddElement(/datum/element/update_icon_blocker) + // Parent call creates our container. Fill it up to max. + reagents.add_reagent(/datum/reagent/medicine/saline_glucose, internal_storage_volume) /obj/machinery/iv_drip/saline/eject_beaker() return diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 52e171e9cd76..253ce6131621 100755 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -385,8 +385,3 @@ grinded = I return to_chat(user, span_warning("You can't grind this!")) - -/obj/item/reagent_containers/glass/saline - name = "saline canister" - volume = 5000 - list_reagents = list(/datum/reagent/medicine/saline_glucose = 5000) diff --git a/icons/obj/iv_drip.dmi b/icons/obj/iv_drip.dmi index 7e06a0c851d2..df9a52b61a48 100644 Binary files a/icons/obj/iv_drip.dmi and b/icons/obj/iv_drip.dmi differ