From cecb518cfb1ea14a1791c1a930b95e6f0136aeb8 Mon Sep 17 00:00:00 2001 From: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Date: Sun, 29 Dec 2019 17:43:32 +1000 Subject: [PATCH] Allows to set department names on fax machines (#6587) --- code/modules/paperwork/faxmachine.dm | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 0db74e3795..88ccf0b3b2 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -118,6 +118,37 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins SSnanoui.update_uis(src) +/obj/machinery/photocopier/faxmachine/attackby(obj/item/O as obj, mob/user as mob) + if(istype(O, /obj/item/weapon/paper) || istype(O, /obj/item/weapon/photo) || istype(O, /obj/item/weapon/paper_bundle)) + if(!copyitem) + user.drop_item() + copyitem = O + O.loc = src + to_chat(user, "You insert \the [O] into \the [src].") + playsound(loc, "sound/machines/click.ogg", 100, 1) + flick(insert_anim, src) + else + to_chat(user, "There is already something in \the [src].") + else if(istype(O, /obj/item/device/multitool) && panel_open) + var/input = sanitize(input(usr, "What Department ID would you like to give this fax machine?", "Multitool-Fax Machine Interface", department)) + if(!input) + to_chat(usr, "No input found. Please hang up and try your call again.") + return + department = input + if( !(("[department]" in alldepartments) || ("[department]" in admin_departments)) && !(department == "Unknown")) + alldepartments |= department + else if(O.is_wrench()) + playsound(loc, O.usesound, 50, 1) + anchored = !anchored + to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].") + + else if(default_deconstruction_screwdriver(user, O)) + return + else if(default_deconstruction_crowbar(user, O)) + return + + return + /obj/machinery/photocopier/faxmachine/proc/sendfax(var/destination) if(stat & (BROKEN|NOPOWER)) return