From b054eb3ee6a36805c984ee86c68d33490d5c36b2 Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Fri, 1 Mar 2024 17:04:25 +0300 Subject: [PATCH] [MIRROR] Allows dragging from boxes into All-In-One Grinders (#2206) * Allows dragging from boxes into All-In-One Grinders (#81591) ## About The Pull Request Simply allows you to drag from storage containers directly onto All-In-One Grinders. Current behavior just spills it on the same tile. ## Why It's Good For The Game I already had to put all these items in the box in the first place, this just makes it slightly easier on the way back. * Allows dragging from boxes into All-In-One Grinders --------- Co-authored-by: NovaBot <154629622+NovaBot13@users.noreply.github.com> Co-authored-by: Echriser --- .../chemistry/machinery/reagentgrinder.dm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm index e7a6c9839eb..6641e63520e 100644 --- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm +++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm @@ -27,6 +27,7 @@ holdingitems = list() beaker = new /obj/item/reagent_containers/cup/beaker/large(src) warn_of_dust() + RegisterSignal(src, COMSIG_STORAGE_DUMP_CONTENT, PROC_REF(on_storage_dump)) /// Add a description to the current beaker warning of blended dust, if it doesn't already have that warning. /obj/machinery/reagentgrinder/proc/warn_of_dust() @@ -205,6 +206,24 @@ holdingitems[weapon] = TRUE return FALSE +/obj/machinery/reagentgrinder/proc/on_storage_dump(datum/source, datum/storage/storage, mob/user) + SIGNAL_HANDLER + + for(var/obj/item/to_dump in storage.real_location) + if(holdingitems.len >= limit) + break + + if(!to_dump.grind_results && !to_dump.juice_typepath) + continue + + if(!storage.attempt_remove(to_dump, src, silent = TRUE)) + continue + + holdingitems[to_dump] = TRUE + + to_chat(user, span_notice("You dump [storage.parent] into [src].")) + return STORAGE_DUMP_HANDLED + /obj/machinery/reagentgrinder/ui_interact(mob/user) // The microwave Menu //I am reasonably certain that this is not a microwave . = ..()