From bdf8323be612e4adc33ee233be8f613a4b80c410 Mon Sep 17 00:00:00 2001 From: Fruerlund Date: Mon, 29 May 2017 22:19:03 +0200 Subject: [PATCH] Adds PEN removal shortcut You can now remove pens from PDAs with CTRL click --- code/modules/pda/PDA.dm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/code/modules/pda/PDA.dm b/code/modules/pda/PDA.dm index 3ff11689078..a473d2d6773 100755 --- a/code/modules/pda/PDA.dm +++ b/code/modules/pda/PDA.dm @@ -311,6 +311,14 @@ var/global/list/obj/item/device/pda/PDAs = list() else to_chat(user, "This PDA does not have an ID in it!") +/obj/item/device/pda/CtrlClick(mob/user) + ..() + if(issilicon(usr)) + return + + if(can_use(user)) + remove_pen() + /obj/item/device/pda/proc/remove_id() if(id) if(ismob(loc)) @@ -338,11 +346,13 @@ var/global/list/obj/item/device/pda/PDAs = list() else to_chat(usr, "You cannot do this while restrained.") - /obj/item/device/pda/verb/verb_remove_pen() set category = "Object" set name = "Remove pen" set src in usr + remove_pen() + +/obj/item/device/pda/proc/remove_pen() if(issilicon(usr)) return @@ -350,19 +360,18 @@ var/global/list/obj/item/device/pda/PDAs = list() if( can_use(usr) ) var/obj/item/weapon/pen/O = locate() in src if(O) + to_chat(usr, "You remove \the [O] from \the [src].") if(istype(loc, /mob)) var/mob/M = loc if(M.get_active_hand() == null) M.put_in_hands(O) - to_chat(usr, "You remove \the [O] from \the [src].") return O.forceMove(get_turf(src)) else - to_chat(usr, "This PDA does not have a pen in it.") + to_chat(usr, "This PDA does not have a pen in it.") else to_chat(usr, "You cannot do this while restrained.") - /obj/item/device/pda/proc/id_check(mob/user as mob, choice as num)//To check for IDs; 1 for in-pda use, 2 for out of pda use. if(choice == 1) if(id)